.task-projects {
  margin: 0 0 6px 19px;
  padding: 7px 0 7px 10px;
  border-left: 1px solid var(--line);
}
.task-projects .section-label {
  margin: 0 0 4px;
  padding: 0 6px;
}
.task-project-items {
  max-height: 26vh;
  overflow-y: auto;
}
.task-project-items .project-item {
  min-height: 40px;
  padding: 7px 9px;
  overflow-wrap: anywhere;
}
.task-project-items .project-dot { flex-shrink: 0; }
.task-project-items .help { padding: 5px 6px; }
.task-display-settings {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}
.task-display-settings:empty { display: none; }
.task-visibility {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #b8c4d8;
  font-size: 14px;
  cursor: pointer;
}
.task-visibility input {
  width: 17px;
  height: 17px;
  margin: 0;
  accent-color: #6c98fa;
}
.mobile-status[hidden], .mobile-task-project-button { display: none; }
.board-layout.single-status { grid-template-columns: minmax(0,1fr); }
@media(max-width:800px) {
  .mobile-task-project-button {
    display: inline-flex;
    min-height: 44px;
    font-size: 14px;
  }
  .task-visibility { min-height: 44px; }
  .task-display-settings { flex-wrap: wrap; }
  .sidebar.open { overflow-y: auto; }
}
.task-scope-switch {
  display: inline-flex;
  gap: 4px;
  margin-bottom: 18px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
}
.task-scope-switch button {
  min-height: 38px;
  padding: 7px 14px;
  border-radius: 7px;
  color: #9ba9bf;
  font-size: 14px;
}
.task-scope-switch button[aria-pressed="true"] {
  color: #dce9ff;
  background: #293852;
}
.admin-section-title {
  margin: 0 0 14px;
  font-size: 18px;
  font-weight: 600;
}
@media(max-width:800px) {
  .task-scope-switch button { min-height: 44px; }
}

.tasks-page .page-head > div:first-child,
.tasks-page .project-heading,
.tasks-page .task-stack,
.task-drawer-body .file-item a {
  min-width: 0;
  overflow-wrap: anywhere;
}
.tasks-page .page-head .head-actions { flex-shrink: 0; }
.tasks-page .board-tabs { scrollbar-width: thin; }
.tasks-page .board-tab { max-width: 26rem; overflow: hidden; text-overflow: ellipsis; }
.tasks-page .board-add,
.tasks-page .board-tabs .icon-btn { flex-shrink: 0; }
.tasks-page .task-toolbar { margin-bottom: 8px; }
.tasks-page .task-toolbar .view-switch { display: flex; }
.task-toolbar .view-switch button { min-width: 34px; min-height: 34px; }
.task-toolbar .search-box:focus-within { outline: 2px solid var(--blue); outline-offset: 2px; }
.tasks-page .board-foot { justify-content: flex-start; font-size: 12px; color: var(--muted); }
.tasks-page .board-foot .row { display: inline-flex; }
.tasks-page .board-foot svg { flex-shrink: 0; }
.tasks-page .column-empty { color: var(--muted); }
.tasks-page .list-task-title { min-width: 0; overflow-wrap: anywhere; }
.tasks-page .list-task .due { flex-shrink: 0; }
.tasks-page .card-top .row { flex-wrap: wrap; }
.tasks-page .task-card .card-context { font-size: 12px; }
.tasks-page .task-card .description { color: var(--muted); }
.tasks-page .task-card .card-bottom .due.overdue { color: #f5a3a5; }
.tasks-page .task-card .card-bottom .due.soon { color: #efc68f; }
.task-created span { display: block; }
.task-optional { font-weight: 400; color: var(--muted); }
.task-form-actions { flex-wrap: wrap; }
.task-form-actions .task-delete,
#board-form .form-actions .danger { margin-right: auto; }
.task-drawer-body .checklist-edit input[type=text] { min-width: 0; }
.task-drawer-body .file-item a { flex: 1; }
:is(#task-form, #project-form, #board-form) .field label > :is(input, textarea) { display: block; margin-top: 7px; }
#board-form .form-actions { flex-wrap: wrap; }
@media(max-width:800px) {
  .tasks-page .page-head { flex-wrap: wrap; align-items: center; }
  .tasks-page .page-head .head-actions { flex-wrap: wrap; padding-top: 0; }
  .tasks-page .page-head .head-actions .btn,
  .tasks-page .column-header .icon-btn,
  .tasks-page .mobile-status button,
  .task-toolbar .view-switch button { min-height: 44px; }
  .tasks-page .column-header .icon-btn,
  .task-toolbar .view-switch button { min-width: 44px; }
  .tasks-page .board-tabs { min-height: 44px; }
  .tasks-page .board-tab { max-width: min(70vw, 22rem); flex-shrink: 0; }
  .task-toolbar .search-box { flex: 1 0 100%; min-height: 44px; }
  .task-toolbar .search-box input { font-size: 16px; }
  .task-toolbar .toolbar-right { display: flex; width: 100%; }
  .task-toolbar .toolbar-right > .select-control,
  .task-toolbar .toolbar-right > .filter { flex: 1; min-width: 0; }
  .tasks-page .list-task {
    display: grid;
    grid-template-columns: auto minmax(0,1fr) auto;
    align-items: center;
    gap: 4px 10px;
  }
  .tasks-page .list-task > .status-icon { grid-area: 1/1; }
  .tasks-page .list-task-title { grid-area: 1/2; }
  .tasks-page .list-task-title h3 { font-size: 14px; line-height: 1.45; }
  .tasks-page .list-task > .badge { display: inline-flex; grid-area: 2/2; justify-self: start; }
  .tasks-page .list-task > .avatar { grid-area: 1/3; justify-self: end; }
  .tasks-page .list-task .due { grid-area: 2/3; margin: 0; font-size: 12px; }
  .tasks-page .task-display-settings { justify-content: space-between; }
  .task-drawer-body .field-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .task-drawer-body .field input,
  .task-drawer-body .field textarea,
  .task-drawer-body .checklist-edit input[type=text],
  .task-drawer-body #comment-form textarea { font-size: 16px; }
}
@media(max-width:430px) {
  .task-drawer-body .field-grid { grid-template-columns: minmax(0,1fr); }
  .task-form-actions, #board-form .form-actions { gap: 4px; }
  .tasks-page .column-empty { padding: 22px 6px; }
}
/* On phones the task buttons wrapped unevenly, leaving «Сохранить» alone on its own row. */
@media (max-width: 520px) {
  .task-form-actions .btn { flex: 1 1 0; }
  .task-form-actions .task-delete + .btn { flex: 1 1 calc(100% - 60px); }
}
