/* Tasks Kanban Task Workspace — built from the shared manage.css tokens/
   classes (--bg/--surface/--border/--text/--muted/--accent, .mp-btn/
   .mp-modal/.mp-field/.mp-people/.mp-avatar). Only net-new pieces (segmented
   view selector, filter bar, Kanban board/lanes/cards, quick-edit popovers,
   drag-and-drop, drawer, tabs, toasts) get their own tk- rules. */

.tk-root {
  max-width: 1440px;
}

.tk-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
  margin-bottom: 2px;
}

.tk-head__actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.tk-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
}

.tk-icon-btn:hover {
  border-color: var(--border-hover);
  color: var(--text);
}

.tk-icon-btn.is-busy svg {
  animation: tk-spin 0.9s linear infinite;
}

@keyframes tk-spin {
  to {
    transform: rotate(360deg);
  }
}

.tk-synced {
  margin: 4px 0 18px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--muted);
}

/* Segmented view selector */
.tk-views {
  display: inline-flex;
  gap: 2px;
  padding: 3px;
  margin-bottom: 16px;
  border-radius: 12px;
  background: var(--surface2);
}

.tk-view {
  min-height: 34px;
  padding: 0 16px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
}

.tk-view.is-active {
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 1px 2px rgba(17, 17, 17, 0.08);
}

/* Sync-degraded banner (normal healthy state: nothing rendered at all) */
.tk-sync-banner {
  margin: 0 0 14px;
  padding: 10px 14px;
  border-radius: 12px;
  background: rgba(180, 35, 24, 0.06);
  color: #92311f;
  font-size: 0.84rem;
  font-weight: 700;
}

.tk-sync-banner[hidden] {
  display: none;
}

/* View tabs + search share a row */
.tk-toolbar-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.tk-search {
  flex: 0 1 320px;
  min-width: 220px;
}

/* Compact filter chips: Open / Due today / Overdue / Critical */
.tk-chips-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.tk-chip-btn {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  min-height: 30px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
}

.tk-chip-btn:hover {
  border-color: var(--border-hover);
}

.tk-chip-btn.is-active {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
}

.tk-chip-btn__count {
  font-weight: 800;
}

.tk-chip-btn--critical.is-active {
  border-color: #df2f4a;
  background: rgba(223, 47, 74, 0.08);
  color: #b42318;
}

.tk-chip-btn--overdue.is-active {
  border-color: #b45309;
  background: rgba(180, 83, 9, 0.08);
  color: #b45309;
}

/* Toolbar / filters */
.tk-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.tk-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  position: relative;
}

.tk-filter {
  position: relative;
}

.tk-filter__btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 0.84rem;
  font-weight: 700;
  cursor: pointer;
}

.tk-filter__btn:hover {
  border-color: var(--border-hover);
}

.tk-filter__btn.has-value {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.tk-filter__count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 800;
}

.tk-filter__menu {
  position: absolute;
  z-index: 40;
  top: calc(100% + 6px);
  left: 0;
  min-width: 200px;
  max-height: 280px;
  overflow: auto;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: 0 12px 32px rgba(17, 17, 17, 0.16);
}

.tk-filter__menu[hidden] {
  display: none;
}

.tk-filter__option {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 0 8px;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
}

.tk-filter__option:hover {
  background: var(--surface2);
}

.tk-filter__option input {
  width: 15px;
  height: 15px;
}

.tk-filter-toggle {
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.tk-toggle {
  margin-left: 4px;
}

.tk-clear {
  border: 0;
  background: transparent;
  color: var(--accent);
  font: inherit;
  font-size: 0.84rem;
  font-weight: 700;
  cursor: pointer;
}

.tk-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}

.tk-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 26px;
  padding: 0 6px 0 10px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--text);
  font-size: 0.76rem;
  font-weight: 700;
}

.tk-chip button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 0.85rem;
  line-height: 1;
}

.tk-chip button:hover {
  background: rgba(17, 17, 17, 0.08);
}

/* -- Kanban board ------------------------------------------------------- */

.tk-board {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  overflow-x: auto;
  padding-bottom: 12px;
}

.tk-board[hidden] {
  display: none;
}

/* Single-lane view (e.g. linked from the My Work "My Tasks" widget --
   ?lane=NEW) -- the one lane fills the available width instead of sitting
   alongside five empty-looking siblings. */
.tk-lane-filter-banner {
  margin: 0 0 10px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--muted);
}

.tk-lane-filter-banner strong {
  color: var(--text);
}

.tk-lane-filter-banner button {
  border: 0;
  background: transparent;
  color: var(--accent);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  padding: 0;
}

.tk-board--single-lane .tk-lane {
  flex: 0 1 480px;
  width: 480px;
  max-width: 100%;
}

.tk-lane {
  flex: 0 0 320px;
  width: 320px;
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 260px);
  min-height: 120px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface2, #f4f5f7);
  overflow: hidden;
}

.tk-lane.is-drop-target {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-soft);
}

.tk-lane.is-collapsed {
  flex: 0 0 auto;
  width: auto;
}

.tk-lane__head {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 12px;
  flex: 0 0 auto;
  background: var(--surface2, #f4f5f7);
  border-bottom: 1px solid var(--border);
  cursor: pointer;
}

.tk-lane__title {
  flex: 1 1 auto;
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.01em;
  white-space: nowrap;
}

.tk-lane__count {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 800;
}

.tk-lane__chevron {
  flex: 0 0 auto;
  color: var(--muted);
  transition: transform 0.15s ease;
}

.tk-lane.is-collapsed .tk-lane__chevron {
  transform: rotate(-90deg);
}

.tk-lane__body {
  flex: 1 1 auto;
  min-height: 40px;
  overflow-y: auto;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.tk-lane.is-collapsed .tk-lane__body,
.tk-lane.is-collapsed .tk-lane__add {
  display: none;
}

.tk-lane__empty {
  padding: 18px 8px;
  text-align: center;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 600;
}

.tk-lane__add {
  flex: 0 0 auto;
  margin: 0 10px 10px;
  padding: 8px;
  border: 1.5px dashed var(--border);
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  text-align: center;
}

.tk-lane__add:hover {
  border-color: var(--border-hover);
  color: var(--text);
  background: var(--surface);
}

/* -- Cards ---------------------------------------------------------------- */

.tk-card {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  padding: 10px 12px;
  cursor: grab;
  transition: box-shadow 0.12s ease, border-color 0.12s ease;
}

.tk-card:hover {
  box-shadow: 0 3px 12px rgba(17, 17, 17, 0.08);
}

.tk-card.is-dragging {
  opacity: 0.5;
}

.tk-card.is-critical {
  border-left: 3px solid #df2f4a;
}

.tk-card__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-bottom: 6px;
}

.tk-pill {
  display: inline-flex;
  align-items: center;
  min-height: 20px;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 0.64rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  cursor: pointer;
  border: 1px solid transparent;
}

.tk-pill:hover {
  filter: brightness(0.96);
}

.tk-pill--subtype {
  background: var(--surface2, #f2f2f2);
  color: var(--muted);
  text-transform: none;
  font-weight: 700;
  letter-spacing: 0;
  cursor: default;
}

.tk-card__menu-btn {
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 6px;
  font-size: 0.9rem;
  line-height: 1;
}

.tk-card__menu-btn:hover {
  background: var(--surface2, #f2f2f2);
  color: var(--text);
}

.tk-card__title {
  margin: 0 0 8px;
  font-weight: 650;
  font-size: 0.86rem;
  line-height: 1.35;
  cursor: pointer;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.tk-card__title:hover {
  color: var(--accent);
}

.tk-card__meta {
  margin: 0 0 8px;
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tk-card__due {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 8px;
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--muted);
  cursor: pointer;
}

.tk-card__due.is-overdue {
  color: #b42318;
}

.tk-card__due.is-today {
  color: #b45309;
}

.tk-card__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.tk-card__owner {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  cursor: pointer;
}

.tk-card__owner-name {
  font-size: 0.78rem;
  font-weight: 700;
  max-width: 100px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tk-card__owner.is-empty {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.tk-stack {
  display: inline-flex;
  align-items: center;
  cursor: pointer;
}

.tk-stack .mp-avatar {
  margin-left: -8px;
  border: 2px solid var(--surface);
}

.tk-stack .mp-avatar:first-child {
  margin-left: 0;
}

.tk-stack__more {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  margin-left: -8px;
  border-radius: 50%;
  border: 2px solid var(--surface);
  background: var(--surface2, #f2f2f2);
  font-size: 0.6rem;
  font-weight: 800;
}

/* Inline subtasks (mini checklist rows on the card, not drawer-only) */
.tk-card__subtasks-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
  border-left: 0;
  border-right: 0;
  border-bottom: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 0.76rem;
  font-weight: 700;
  cursor: pointer;
  text-align: left;
}

.tk-card__subtasks-toggle:hover {
  color: var(--text);
}

.tk-card__subtasks-chevron {
  display: inline-block;
  transition: transform 0.15s ease;
}

.tk-card.subtasks-open .tk-card__subtasks-chevron {
  transform: rotate(90deg);
}

.tk-card__subtasks-body {
  display: none;
  margin-top: 8px;
  padding-top: 4px;
}

.tk-card.subtasks-open .tk-card__subtasks-body {
  display: block;
}

.tk-mini-sub {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 0;
  font-size: 0.78rem;
}

.tk-mini-sub__check {
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
  border-radius: 5px;
  border: 1.5px solid var(--border);
  background: var(--surface);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
}

.tk-mini-sub.is-done .tk-mini-sub__check {
  background: var(--accent);
  border-color: var(--accent);
}

.tk-mini-sub__name {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 600;
  cursor: pointer;
}

.tk-mini-sub.is-done .tk-mini-sub__name {
  text-decoration: line-through;
  color: var(--muted);
}

.tk-mini-sub__owner {
  flex: 0 0 auto;
  font-size: 0.68rem;
  font-weight: 800;
  color: var(--muted);
  cursor: pointer;
}

.tk-mini-sub-add {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
}

.tk-mini-sub-add input {
  flex: 1 1 auto;
  min-height: 26px;
  padding: 2px 8px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  font: inherit;
  font-size: 0.78rem;
}

.tk-card__sync {
  margin-top: 6px;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--muted);
}

.tk-card__sync.is-error {
  color: #b42318;
  cursor: pointer;
}

/* -- Quick-edit popovers (status/priority/owner/date/watchers) ----------- */

.tk-popover {
  position: fixed;
  z-index: 120;
  min-width: 200px;
  max-width: 280px;
  max-height: 320px;
  overflow: auto;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: 0 16px 40px rgba(17, 17, 17, 0.2);
}

.tk-popover[hidden] {
  display: none;
}

.tk-popover__option {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 0 8px;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  border: 0;
  background: transparent;
  width: 100%;
  text-align: left;
  font-family: inherit;
  color: inherit;
}

.tk-popover__option:hover {
  background: var(--surface2, #f2f2f2);
}

.tk-popover__option.is-selected {
  font-weight: 800;
}

.tk-popover__input {
  width: 100%;
  min-height: 32px;
  padding: 4px 8px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  font: inherit;
  margin-bottom: 6px;
}

/* Status chooser (used for ambiguous lane drops: WAITING/ATTENTION/DONE) */
.tk-status-chooser {
  position: fixed;
  inset: 0;
  z-index: 130;
}

.tk-status-chooser[hidden] {
  display: none;
}

.tk-status-chooser__backdrop {
  position: absolute;
  inset: 0;
  background: transparent;
}

.tk-status-chooser__menu {
  position: absolute;
  min-width: 220px;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: 0 16px 40px rgba(17, 17, 17, 0.22);
}


/* Drawer */
.tk-drawer-overlay {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: flex;
  justify-content: flex-end;
}

.tk-drawer-overlay[hidden] {
  display: none;
}

.tk-drawer-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(17, 17, 17, 0.4);
}

.tk-drawer {
  position: relative;
  z-index: 1;
  width: min(560px, 100vw);
  height: 100%;
  background: var(--bg);
  border-left: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  box-shadow: -18px 0 48px rgba(17, 17, 17, 0.16);
}

.tk-drawer__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: calc(18px + var(--safe-top)) 20px 12px;
}

.tk-drawer__title {
  margin: 0;
  font-size: 1.3rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.25;
}

.tk-drawer__subtitle {
  margin: 4px 0 0;
  color: var(--muted);
  font-weight: 600;
  font-size: 0.85rem;
}

.tk-drawer__close {
  flex: 0 0 auto;
  width: 32px;
  height: 32px;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--surface);
  cursor: pointer;
  color: var(--muted);
}

.tk-drawer__quick {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0 20px 14px;
  border-bottom: 1px solid var(--border);
}

.tk-drawer__tabs {
  display: flex;
  gap: 4px;
  padding: 10px 20px 0;
  border-bottom: 1px solid var(--border);
}

.tk-tab {
  min-height: 36px;
  padding: 0 4px 10px;
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  margin-right: 14px;
}

.tk-tab.is-active {
  color: var(--text);
  border-bottom-color: var(--accent);
}

.tk-drawer__body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 16px 20px calc(24px + var(--safe-bottom));
}

.tk-panel {
  display: none;
}

.tk-panel.is-active {
  display: block;
}

.tk-required-action {
  margin: 0 0 16px;
  padding: 14px 16px;
  border-radius: 14px;
  background: var(--accent-soft);
}

.tk-required-action h3 {
  margin: 0 0 6px;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.tk-required-action p {
  margin: 0;
  white-space: pre-wrap;
  font-weight: 650;
  line-height: 1.5;
}

.tk-meta-line {
  margin: 10px 0;
  font-size: 0.78rem;
  color: var(--muted);
  font-weight: 600;
}

.tk-collapsible summary {
  cursor: pointer;
  font-weight: 800;
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 10px 0;
  border-top: 1px solid var(--border);
}

.tk-collapsible p {
  margin: 4px 0 12px;
  white-space: pre-wrap;
  line-height: 1.5;
}

/* Updates feed */
.tk-update-form textarea {
  width: 100%;
  min-height: 84px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  font: inherit;
  resize: vertical;
}

.tk-update-form__row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 8px;
  gap: 8px;
}

.tk-update-list {
  display: grid;
  gap: 14px;
  margin-top: 18px;
}

.tk-update {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  gap: 10px;
}

.tk-update__head {
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
}

.tk-update__name {
  font-weight: 800;
  font-size: 0.88rem;
}

.tk-update__time {
  font-size: 0.76rem;
  color: var(--muted);
  font-weight: 600;
}

.tk-update__body {
  margin: 4px 0 0;
  line-height: 1.5;
  font-size: 0.9rem;
  white-space: pre-wrap;
}

.tk-update__body a {
  color: var(--accent);
}

.tk-update__reply {
  margin-top: 6px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  padding: 0;
}

.tk-update__replies {
  margin-top: 10px;
  padding-left: 14px;
  border-left: 2px solid var(--border);
  display: grid;
  gap: 10px;
}

/* Subtasks */
.tk-sub-list {
  display: grid;
  gap: 8px;
}

.tk-sub-row {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
}

.tk-sub-row__name {
  min-width: 0;
  font-weight: 700;
  font-size: 0.88rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tk-sub-row.is-done .tk-sub-row__name {
  text-decoration: line-through;
  color: var(--muted);
}

/* Source tab */
.tk-source-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 10px 0 16px;
}

/* Toasts */
.tk-toasts {
  position: fixed;
  z-index: 200;
  bottom: calc(16px + var(--safe-bottom));
  right: 16px;
  display: grid;
  gap: 8px;
  max-width: min(340px, calc(100vw - 32px));
}

.tk-toast {
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--text);
  color: var(--bg);
  font-size: 0.85rem;
  font-weight: 700;
  box-shadow: 0 12px 32px rgba(17, 17, 17, 0.24);
}

.tk-toast--error {
  background: #b42318;
  color: #fff;
}

/* People field (create modal / drawer watchers editor) */
.tk-people-field .mp-people__chips {
  min-height: 30px;
}

.tk-people-field input[type="text"] {
  width: 100%;
  min-height: 38px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  font: inherit;
}

@media (max-width: 960px) {
  .tk-chips-row {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 4px;
    -webkit-overflow-scrolling: touch;
  }

  .tk-toolbar {
    align-items: flex-start;
  }

  .tk-filters {
    display: none;
  }

  .tk-filters.is-open {
    display: flex;
    width: 100%;
    order: 3;
  }

  .tk-filter-toggle {
    display: inline-flex;
  }

  .tk-lane {
    flex-basis: 84vw;
    width: 84vw;
    scroll-snap-align: start;
  }

  .tk-board {
    scroll-snap-type: x mandatory;
  }

  .tk-drawer {
    width: 100vw;
  }
}

/* -------------------------------------------------------------------------
   Tasks visual refresh
   A calmer workspace shell, clearer workflow hierarchy, and responsive
   controls. These rules intentionally sit last while the legacy selectors
   above remain as a compatibility layer for dynamically-rendered elements.
   ---------------------------------------------------------------------- */

.tk-root {
  --tk-lane-color: #8a9099;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: none;
  min-width: 0;
  min-height: 0;
}

.tk-head {
  display: none !important;
  align-items: center;
  margin: 0 0 10px;
  padding: 0 2px;
}

.tk-head__copy {
  min-width: 0;
}

.tk-head .mp-title {
  margin-bottom: 2px;
  font-size: clamp(1.6rem, 2.2vw, 1.85rem);
  letter-spacing: -0.035em;
}

.tk-head .mp-eyebrow {
  margin-bottom: 4px;
  font-size: 0.66rem;
}

.tk-head .mp-subtitle {
  font-size: 0.78rem;
}

.tk-new-task {
  min-height: 36px;
  flex: 0 0 auto;
  gap: 5px;
  padding: 0 10px;
  border-radius: 10px;
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
  font-size: 0.72rem;
  box-shadow: 0 8px 20px rgba(255, 90, 0, 0.2);
  transition: transform 140ms ease, box-shadow 140ms ease, background 140ms ease;
}

.tk-new-task:hover {
  border-color: var(--accent-hover);
  background: var(--accent-hover);
  box-shadow: 0 10px 24px rgba(255, 90, 0, 0.26);
  transform: translateY(-1px);
}

.tk-new-task:active {
  transform: translateY(0);
}

.tk-control-panel {
  flex: 0 0 auto;
  margin-bottom: 9px;
  padding: 8px;
  border: 1px solid rgba(17, 17, 17, 0.08);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 8px 28px rgba(17, 17, 17, 0.045);
}

.tk-control-line {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 6px;
  min-width: 0;
}

.tk-views {
  flex: 0 0 auto;
  margin: 0;
  padding: 2px;
  border-radius: 10px;
  background: #f0f1f3;
}

.tk-view {
  min-height: 30px;
  padding: 0 7px;
  border-radius: 8px;
  font-size: 0.74rem;
  transition: color 140ms ease, background 140ms ease, box-shadow 140ms ease;
}

.tk-view:hover {
  color: var(--text);
}

.tk-view.is-active {
  background: var(--surface);
  box-shadow: 0 1px 4px rgba(17, 17, 17, 0.12);
}

.tk-search {
  flex: 1 1 190px;
  min-width: 125px;
  max-width: 250px;
  min-height: 34px;
  margin-left: 0;
  border-color: rgba(17, 17, 17, 0.11);
  border-radius: 9px;
  background: #fafafa;
  transition: border-color 140ms ease, background 140ms ease, box-shadow 140ms ease;
}

.tk-search:focus-within {
  border-color: rgba(255, 90, 0, 0.48);
  background: var(--surface);
  box-shadow: 0 0 0 3px rgba(255, 90, 0, 0.09);
}

.tk-search input {
  min-height: 32px;
  font-size: 0.75rem;
}

.tk-chips-row {
  flex: 0 0 auto;
  flex-wrap: nowrap;
  min-height: 28px;
  gap: 4px;
  margin: 0;
}

.tk-chip-btn {
  min-height: 28px;
  gap: 4px;
  padding: 0 5px 0 9px;
  border-color: transparent;
  background: #f3f4f5;
  color: rgba(17, 17, 17, 0.7);
  font-size: 0.7rem;
  transition: border-color 140ms ease, background 140ms ease, color 140ms ease;
}

.tk-chip-btn:hover {
  border-color: rgba(17, 17, 17, 0.1);
  background: #eceef0;
  color: var(--text);
}

.tk-chip-btn.is-active {
  border-color: rgba(255, 90, 0, 0.25);
  background: rgba(255, 90, 0, 0.1);
}

.tk-chip-btn__count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 19px;
  height: 19px;
  padding: 0 5px;
  border-radius: 999px;
  background: rgba(17, 17, 17, 0.07);
  color: var(--text);
  font-size: 0.63rem;
}

.tk-chip-btn.is-active .tk-chip-btn__count {
  background: var(--surface);
  color: var(--accent);
}

.tk-chip-btn--critical.is-active .tk-chip-btn__count,
.tk-chip-btn--overdue.is-active .tk-chip-btn__count {
  color: currentColor;
}

.tk-toolbar {
  flex-wrap: nowrap;
  gap: 8px;
  min-width: 0;
  margin: 0;
  padding-top: 10px;
  border-top: 1px solid rgba(17, 17, 17, 0.07);
}

.tk-toolbar__label {
  display: none;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
  margin-right: 2px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.tk-filters {
  display: flex;
  flex: 0 0 auto;
  flex-wrap: nowrap;
  gap: 5px;
  min-width: 0;
}

.tk-filter-select {
  width: 96px;
  min-width: 96px;
  min-height: 32px;
  padding: 0 18px 0 7px;
  border: 1px solid rgba(17, 17, 17, 0.1);
  border-radius: 8px;
  background-color: #fafafa;
  color: var(--text);
  font: inherit;
  font-size: 0.71rem;
  font-weight: 700;
  cursor: pointer;
  outline: none;
}

.tk-filter-select:hover,
.tk-filter-select:focus {
  border-color: rgba(255, 90, 0, 0.4);
  background-color: var(--surface);
}

.tk-toggle {
  flex: 0 0 auto;
  min-height: 32px;
  margin: 0;
  padding: 0 3px;
  color: rgba(17, 17, 17, 0.72);
  font-size: 0.7rem;
  white-space: nowrap;
  cursor: pointer;
}

.tk-toggle__label {
  display: none;
}

.tk-toggle input {
  position: relative;
  appearance: none;
  width: 30px;
  height: 18px;
  margin: 0;
  border: 1px solid rgba(17, 17, 17, 0.14);
  border-radius: 999px;
  background: #e7e9eb;
  cursor: pointer;
  transition: border-color 140ms ease, background 140ms ease;
}

.tk-toggle input::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(17, 17, 17, 0.2);
  transition: transform 140ms ease;
}

.tk-toggle input:checked {
  border-color: var(--accent);
  background: var(--accent);
}

.tk-toggle input:checked::after {
  transform: translateX(12px);
}

.tk-toggle input:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.tk-clear {
  flex: 0 0 auto;
  min-height: 30px;
  padding: 0 6px;
  border-radius: 8px;
  font-size: 0.68rem;
}

.tk-clear:hover {
  background: var(--accent-soft);
}

.tk-active-filters {
  display: none !important;
  flex-wrap: wrap;
  gap: 6px;
  padding-top: 7px;
}

.tk-active-filters[hidden] {
  display: none;
}

.tk-chip {
  min-height: 28px;
  border: 1px solid rgba(255, 90, 0, 0.15);
  background: rgba(255, 90, 0, 0.08);
  color: rgba(17, 17, 17, 0.76);
}

.tk-sync-banner {
  margin-bottom: 12px;
  border: 1px solid rgba(180, 35, 24, 0.12);
}

.tk-board-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex: 0 0 auto;
  min-height: 28px;
  padding: 0 3px;
  margin-bottom: 5px;
}

.tk-board-head__title {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
  font-size: 0.76rem;
  font-weight: 800;
}

.tk-board-head__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 7px;
  background: rgba(255, 90, 0, 0.09);
  color: var(--accent);
}

.tk-board-head p {
  margin: 0;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 650;
}

.tk-state {
  display: grid;
  place-items: center;
  flex: 1 1 auto;
  min-height: 220px;
  margin: 0;
  border: 1px dashed rgba(17, 17, 17, 0.12);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.55);
  text-align: center;
}

.tk-state[hidden] {
  display: none;
}

.tk-board {
  align-items: stretch;
  gap: 9px;
  min-width: 0;
  min-height: 0;
  padding: 1px 3px 10px;
  overscroll-behavior-x: contain;
}

.tk-lane {
  --tk-lane-color: #8a9099;
  --tk-lane-soft: rgba(138, 144, 153, 0.09);
  flex: 0 0 252px;
  width: 252px;
  max-height: calc(100dvh - 300px);
  border-color: rgba(17, 17, 17, 0.09);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.52);
  box-shadow: 0 4px 18px rgba(17, 17, 17, 0.035);
}

.tk-lane[data-lane="IN_PROGRESS"] {
  --tk-lane-color: #ff5a00;
  --tk-lane-soft: rgba(255, 90, 0, 0.09);
}

.tk-lane[data-lane="WAITING"] {
  --tk-lane-color: #d08700;
  --tk-lane-soft: rgba(208, 135, 0, 0.09);
}

.tk-lane[data-lane="ATTENTION"] {
  --tk-lane-color: #c43b32;
  --tk-lane-soft: rgba(196, 59, 50, 0.08);
}

.tk-lane[data-lane="APPROVAL"] {
  --tk-lane-color: #7357a6;
  --tk-lane-soft: rgba(115, 87, 166, 0.09);
}

.tk-lane[data-lane="DONE"] {
  --tk-lane-color: #3a8c63;
  --tk-lane-soft: rgba(58, 140, 99, 0.09);
}

.tk-lane.is-drop-target {
  border-color: var(--tk-lane-color);
  background: var(--tk-lane-soft);
  box-shadow: 0 0 0 3px var(--tk-lane-soft);
}

.tk-lane__head {
  width: 100%;
  min-height: 41px;
  padding: 0 10px;
  border: 0;
  border-bottom: 1px solid rgba(17, 17, 17, 0.07);
  border-radius: 0;
  background: rgba(255, 255, 255, 0.72);
  color: var(--text);
  font: inherit;
  text-align: left;
  transition: background 140ms ease;
}

.tk-lane__head:hover {
  background: var(--surface);
}

.tk-lane__head::before {
  content: "";
  flex: 0 0 auto;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--tk-lane-color);
  box-shadow: 0 0 0 4px var(--tk-lane-soft);
}

.tk-lane__title {
  font-size: 0.74rem;
  letter-spacing: 0;
}

.tk-lane__count {
  min-width: 21px;
  height: 19px;
  font-size: 0.64rem;
  border: 0;
  background: var(--tk-lane-soft);
  color: var(--tk-lane-color);
}

.tk-lane__chevron {
  order: 4;
}

.tk-lane__body {
  gap: 7px;
  min-height: 44px;
  padding: 8px;
}

.tk-lane__empty {
  display: grid;
  place-items: center;
  min-height: 78px;
  margin: 0;
  border: 1px dashed rgba(17, 17, 17, 0.1);
  border-radius: 10px;
  font-size: 0.7rem;
  background: rgba(255, 255, 255, 0.42);
}

.tk-lane__add {
  min-height: 32px;
  margin: 0 8px 8px;
  border-width: 1px;
  border-color: transparent;
  border-radius: 8px;
  font-size: 0.72rem;
  color: rgba(17, 17, 17, 0.5);
}

.tk-lane__add:hover {
  border-color: rgba(255, 90, 0, 0.18);
  background: rgba(255, 90, 0, 0.07);
  color: var(--accent);
}

.tk-lane.is-collapsed {
  flex: 0 0 54px;
  width: 54px;
  min-height: 180px;
}

.tk-lane.is-collapsed .tk-lane__head {
  flex-direction: column;
  justify-content: flex-start;
  min-height: 180px;
  height: 100%;
  gap: 10px;
  padding: 15px 0;
  border-bottom: 0;
}

.tk-lane.is-collapsed .tk-lane__title {
  flex: 0 0 auto;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
}

.tk-lane.is-collapsed .tk-lane__chevron {
  transform: rotate(-90deg);
}

.tk-card {
  position: relative;
  padding: 10px;
  border-color: rgba(17, 17, 17, 0.09);
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(17, 17, 17, 0.035);
  transition: transform 140ms ease, box-shadow 140ms ease, border-color 140ms ease;
}

.tk-card:hover {
  border-color: rgba(17, 17, 17, 0.14);
  box-shadow: 0 8px 22px rgba(17, 17, 17, 0.08);
  transform: translateY(-1px);
}

.tk-card.is-critical {
  border-left: 1px solid rgba(17, 17, 17, 0.09);
}

.tk-card.is-critical::before {
  content: "";
  position: absolute;
  top: 10px;
  bottom: 10px;
  left: -1px;
  width: 3px;
  border-radius: 0 999px 999px 0;
  background: #c43b32;
}

.tk-card.is-dragging {
  opacity: 0.58;
  transform: rotate(1deg) scale(0.985);
}

.tk-card__top {
  justify-content: flex-start;
  margin-bottom: 6px;
}

.tk-pill {
  min-height: 20px;
  padding: 0 7px;
  font-size: 0.57rem;
  letter-spacing: 0.045em;
}

.tk-pill--subtype {
  max-width: 132px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tk-card__menu-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 24px;
  height: 24px;
  margin-left: auto;
  padding: 0;
  border-radius: 8px;
}

.tk-card__title {
  display: -webkit-box;
  width: 100%;
  margin: 0 0 5px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 0.82rem;
  font-weight: 750;
  line-height: 1.3;
  text-align: left;
}

.tk-card__title:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

.tk-card__meta {
  margin-bottom: 7px;
  color: rgba(17, 17, 17, 0.48);
  font-size: 0.67rem;
}

.tk-card__due {
  min-height: 21px;
  margin: 0 0 8px;
  padding: 0 6px;
  border-radius: 6px;
  background: #f3f4f5;
  color: rgba(17, 17, 17, 0.62);
  font-size: 0.64rem;
}

.tk-card__due.is-overdue {
  background: rgba(180, 35, 24, 0.08);
}

.tk-card__due.is-today {
  background: rgba(180, 83, 9, 0.09);
}

.tk-card__footer {
  min-height: 24px;
}

.tk-card .mp-avatar,
.tk-card .mp-avatar--sm {
  width: 22px;
  height: 22px;
  font-size: 0.55rem;
}

.tk-card__owner-name {
  max-width: 108px;
  color: rgba(17, 17, 17, 0.7);
  font-size: 0.67rem;
}

.tk-card__owner.is-empty {
  min-height: 26px;
  padding: 0 8px;
  border-radius: 8px;
  background: #f4f5f6;
  font-size: 0.72rem;
}

.tk-card__watchers-empty {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border: 1px dashed rgba(17, 17, 17, 0.15);
  border-radius: 50%;
  color: rgba(17, 17, 17, 0.42);
}

.tk-card__subtasks-toggle {
  margin-top: 7px;
  padding-top: 7px;
  font-size: 0.66rem;
}

.tk-popover,
.tk-status-chooser__menu {
  padding: 7px;
  border-color: rgba(17, 17, 17, 0.1);
  border-radius: 14px;
  box-shadow: 0 18px 48px rgba(17, 17, 17, 0.17);
}

.tk-popover__option {
  min-height: 38px;
  border-radius: 9px;
  font-size: 0.82rem;
}

.tk-popover__option.is-selected {
  background: var(--accent-soft);
  color: var(--accent);
}

.tk-drawer-backdrop {
  background: rgba(17, 17, 17, 0.32);
  backdrop-filter: blur(2px);
}

.tk-drawer {
  width: min(620px, 100vw);
  border-left-color: rgba(17, 17, 17, 0.1);
  background: #f7f7f8;
  box-shadow: -24px 0 64px rgba(17, 17, 17, 0.18);
}

.tk-drawer__head {
  padding: calc(24px + var(--safe-top)) 24px 17px;
  background: var(--surface);
}

.tk-drawer__title-wrap {
  min-width: 0;
}

.tk-drawer__eyebrow {
  margin: 0 0 7px;
  color: var(--accent);
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.tk-drawer__title {
  font-size: clamp(1.28rem, 2vw, 1.55rem);
}

.tk-drawer__close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-color: transparent;
  background: #f2f3f4;
  transition: background 140ms ease, color 140ms ease;
}

.tk-drawer__close:hover {
  background: #e8eaec;
  color: var(--text);
}

.tk-drawer__quick {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  padding: 0 24px 18px;
  background: var(--surface);
}

.tk-quick-field {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  min-width: 0;
  min-height: 54px;
  padding: 8px 10px;
  border: 1px solid rgba(17, 17, 17, 0.08);
  border-radius: 11px;
  background: #fafafa;
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.tk-quick-field:hover {
  border-color: rgba(255, 90, 0, 0.28);
  background: rgba(255, 90, 0, 0.045);
}

.tk-quick-field__label {
  color: var(--muted);
  font-size: 0.62rem;
  font-weight: 750;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.tk-quick-field__value {
  width: 100%;
  overflow: hidden;
  color: var(--text);
  font-size: 0.76rem;
  font-weight: 750;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tk-drawer__tabs {
  gap: 18px;
  padding: 0 24px;
  background: var(--surface);
}

.tk-tab {
  min-height: 43px;
  margin: 0;
  padding: 0 0 10px;
  font-size: 0.8rem;
}

.tk-tab:hover {
  color: var(--text);
}

.tk-drawer__body {
  padding: 20px 24px calc(28px + var(--safe-bottom));
}

.tk-required-action {
  padding: 16px;
  border: 1px solid rgba(255, 90, 0, 0.14);
  background: rgba(255, 90, 0, 0.075);
}

.tk-overview-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 16px;
}

.tk-meta-line {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  min-height: 62px;
  margin: 0;
  padding: 11px 12px;
  border: 1px solid rgba(17, 17, 17, 0.08);
  border-radius: 12px;
  background: var(--surface);
}

.tk-meta-line__label {
  color: var(--muted);
  font-size: 0.65rem;
  font-weight: 750;
  letter-spacing: 0.045em;
  text-transform: uppercase;
}

.tk-meta-line__value {
  overflow-wrap: anywhere;
  color: var(--text);
  font-size: 0.84rem;
  font-weight: 700;
  line-height: 1.35;
}

.tk-collapsible {
  margin-top: 8px;
  border: 1px solid rgba(17, 17, 17, 0.08);
  border-radius: 12px;
  background: var(--surface);
  overflow: hidden;
}

.tk-collapsible summary {
  padding: 13px 14px;
  border-top: 0;
}

.tk-collapsible p {
  margin: 0;
  padding: 0 14px 14px;
}

.tk-update-form,
.tk-sub-row {
  border-color: rgba(17, 17, 17, 0.08);
  background: var(--surface);
}

.tk-update-form {
  padding: 14px;
  border: 1px solid rgba(17, 17, 17, 0.08);
  border-radius: 14px;
}

.tk-update-form textarea:focus,
.tk-mini-sub-add input:focus,
.tk-people-field input[type="text"]:focus,
.tk-create-dialog input:focus,
.tk-create-dialog select:focus,
.tk-create-dialog textarea:focus {
  border-color: rgba(255, 90, 0, 0.45);
  box-shadow: 0 0 0 3px rgba(255, 90, 0, 0.08);
  outline: none;
}

.tk-sub-row {
  min-height: 48px;
  box-shadow: 0 2px 7px rgba(17, 17, 17, 0.025);
}

.tk-toast {
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 13px;
}

.tk-create-dialog {
  display: flex;
  flex-direction: column;
  width: min(720px, calc(100vw - 32px));
  max-height: min(88dvh, 820px);
  padding: 0;
  border-radius: 20px;
  overflow: hidden;
}

.tk-create-dialog__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex: 0 0 auto;
  padding: 22px 24px 17px;
  border-bottom: 1px solid rgba(17, 17, 17, 0.08);
}

.tk-create-dialog__head .mp-modal__title {
  margin: 3px 0 5px;
  font-size: 1.35rem;
}

.tk-create-dialog__subtitle {
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 600;
}

.tk-create-dialog > .mp-form-error {
  margin: 16px 24px 0;
}

.tk-create-dialog form {
  min-height: 0;
  padding: 18px 24px 0;
  overflow-y: auto;
}

.tk-create-dialog .mp-form-grid {
  gap: 15px 16px;
}

.tk-create-dialog .mp-field label {
  letter-spacing: 0.055em;
}

.tk-create-dialog .mp-field input,
.tk-create-dialog .mp-field select,
.tk-create-dialog .mp-field textarea,
.tk-people-field input[type="text"] {
  min-height: 42px;
  border-color: rgba(17, 17, 17, 0.11);
  border-radius: 11px;
  background: #fafafa;
}

.tk-create-advanced {
  margin-top: 2px;
  border-top: 1px solid rgba(17, 17, 17, 0.08);
}

.tk-create-advanced summary {
  padding: 14px 2px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  cursor: pointer;
}

.tk-create-advanced__grid {
  margin: 0 0 4px;
}

.tk-create-dialog .mp-modal__actions {
  position: sticky;
  bottom: 0;
  margin: 0 -24px;
  padding: 14px 24px calc(14px + var(--safe-bottom));
  border-top: 1px solid rgba(17, 17, 17, 0.08);
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(8px);
}

@media (min-width: 961px) {
  .mp-main--tasks {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding-bottom: calc(16px + var(--safe-bottom));
  }

  .mp-main--tasks > .mp-topbar {
    flex: 0 0 auto;
  }

  .mp-main--tasks > .tk-root {
    flex: 1 1 auto;
  }

  .tk-board {
    flex: 1 1 auto;
  }

  .tk-lane {
    height: 100%;
    max-height: none;
  }
}

@media (max-width: 1100px) and (min-width: 961px) {
  .tk-toolbar__label {
    display: none;
  }

  .tk-filter-select {
    width: 92px;
    min-width: 92px;
  }

  .tk-toggle__label {
    display: none;
  }

  .tk-search {
    flex-basis: 155px;
    min-width: 140px;
  }
}

@media (max-width: 960px) {
  .tk-root {
    min-height: auto;
  }

  .tk-control-panel {
    padding: 11px;
  }

  .tk-control-line {
    flex-wrap: wrap;
    gap: 7px;
  }

  .tk-new-task {
    order: 1;
  }

  .tk-views {
    order: 3;
  }

  .tk-search {
    order: 2;
    margin-left: 0;
  }

  .tk-chips-row {
    order: 4;
  }

  .tk-toolbar {
    flex-wrap: wrap;
  }

  .tk-toolbar__label {
    display: none;
  }

  .tk-filters,
  .tk-filters.is-open {
    display: flex;
    order: 5;
    width: auto;
  }

  .tk-toggle {
    order: 5;
  }

  .tk-toggle__label {
    display: inline;
  }

  .tk-clear {
    order: 6;
  }

  .tk-lane {
    flex-basis: min(82vw, 330px);
    width: min(82vw, 330px);
    max-height: 68dvh;
  }

  .tk-board {
    scroll-padding-inline: 3px;
  }
}

@media (max-width: 640px) {
  .tk-head {
    align-items: flex-end;
    gap: 10px;
    margin-bottom: 14px;
  }

  .tk-head .mp-subtitle {
    max-width: 230px;
    font-size: 0.82rem;
  }

  .tk-new-task {
    min-height: 40px;
    padding: 0 13px;
  }

  .tk-control-panel {
    margin-right: -4px;
    margin-left: -4px;
    border-radius: 16px;
  }

  .tk-control-line {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 9px;
  }

  .tk-new-task {
    grid-column: 1 / -1;
    width: 100%;
  }

  .tk-views {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    grid-column: 1 / -1;
    width: 100%;
  }

  .tk-view {
    padding: 0 7px;
  }

  .tk-search {
    grid-column: 1 / -1;
    width: 100%;
    min-width: 0;
    max-width: none;
  }

  .tk-chips-row {
    grid-column: 1 / -1;
    flex-wrap: nowrap;
    margin-right: -11px;
    padding-right: 11px;
    overflow-x: auto;
  }

  .tk-chip-btn {
    flex: 0 0 auto;
  }

  .tk-toolbar {
    align-items: center;
  }

  .tk-filters,
  .tk-filters.is-open {
    grid-column: 1 / -1;
    flex: 1 1 100%;
    width: 100%;
    padding-bottom: 3px;
    overflow-x: auto;
  }

  .tk-filter-select {
    flex: 0 0 145px;
  }

  .tk-toggle {
    grid-column: 1;
    margin-left: 0;
  }

  .tk-clear {
    grid-column: 2;
  }

  .tk-board-head p {
    display: none;
  }

  .tk-lane {
    flex-basis: calc(100vw - 48px);
    width: calc(100vw - 48px);
  }

  .tk-drawer__head {
    padding: calc(20px + var(--safe-top)) 18px 15px;
  }

  .tk-drawer__quick {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding: 0 18px 16px;
  }

  .tk-drawer__tabs {
    gap: 17px;
    padding: 0 18px;
    overflow-x: auto;
  }

  .tk-tab {
    flex: 0 0 auto;
  }

  .tk-drawer__body {
    padding: 18px 18px calc(24px + var(--safe-bottom));
  }

  .tk-overview-grid {
    grid-template-columns: 1fr;
  }

  .tk-create-dialog {
    align-self: end;
    width: 100%;
    max-height: calc(94dvh - var(--safe-top));
    border-radius: 20px 20px 0 0;
  }

  #tk-create-modal {
    align-items: end;
    padding: 0;
  }

  .tk-create-dialog__head {
    padding: 19px 18px 15px;
  }

  .tk-create-dialog > .mp-form-error {
    margin: 14px 18px 0;
  }

  .tk-create-dialog form {
    padding: 16px 18px 0;
  }

  .tk-create-dialog .mp-form-grid {
    grid-template-columns: 1fr;
  }

  .tk-create-dialog .mp-field--full,
  .tk-create-advanced {
    grid-column: auto;
  }

  .tk-create-dialog .mp-modal__actions {
    margin: 0 -18px;
    padding-right: 18px;
    padding-left: 18px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .tk-new-task,
  .tk-view,
  .tk-card,
  .tk-toggle input,
  .tk-toggle input::after {
    transition: none;
  }
}
