/* Создание задачи: окно поверх страницы и отдельная страница для прямой ссылки. */
.lg-shell.lg-dialog.task-create-dialog { width: min(640px, calc(100vw - 32px)); max-width: 640px; max-height: calc(100vh - 48px); max-height: calc(100dvh - 48px); overflow: visible; }
.lg-shell.lg-dialog.task-create-dialog[open] { display: flex; flex-direction: column; }
#taskCreateModalContent { display: contents; }

.task-create { display: flex; flex-direction: column; flex: 1 1 auto; min-height: 0; }
.lg-shell .task-create .lg-dialog-head { flex: 0 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 22px; border-bottom: 1px solid var(--lg-border); border-radius: 14px 14px 0 0; }
.lg-shell .task-create .task-create__body { flex: 1 1 auto; min-height: 0; overflow-x: hidden; overflow-y: auto; padding: 20px 22px; }
.lg-shell .task-create .task-create__footer { flex: 0 0 auto; display: flex; align-items: center; justify-content: flex-end; gap: 8px; margin: 0; padding: 12px 22px; border-top: 1px solid var(--lg-border); border-radius: 0 0 14px 14px; }
.task-create__another { margin-right: auto; }
.task-create__context { margin-top: 2px; font-size: var(--lg-type-meta); color: var(--lg-muted); font-weight: 400; }
.task-create__required { color: var(--lg-danger); }
.task-create [hidden] { display: none !important; }

.lg-shell .task-create .lg-field,
.lg-shell.lg-dialog .task-create .lg-field + .lg-field { display: flex; flex-direction: column; gap: 5px; min-width: 0; margin: 0 0 14px; }
.task-create .lg-attention { margin-bottom: 12px; }
.lg-shell .task-create .task-create__title { width: 100%; height: auto; min-height: 64px; max-height: 180px; padding: 10px 12px; resize: none; font-size: 15px; line-height: 1.45; }
.task-create__label { display: block; margin-bottom: 4px; font-size: var(--lg-type-meta); color: var(--lg-muted); }
.task-create__details { margin-bottom: 14px; }
.task-create__details .task-description-editor { min-height: 90px; max-height: 220px; overflow-y: auto; }
.task-create__grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; gap: 0 16px; }
.task-create__quick { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.task-create__quick .lg-btn.is-selected,
.task-create__tools .lg-btn[aria-expanded="true"] { background: var(--lg-primary-soft); border-color: var(--lg-primary); color: var(--lg-primary); }
.task-create input[data-date-picker] { width: 100%; max-width: none; }
.task-create__tools { display: flex; flex-wrap: wrap; gap: 8px; }
.task-create__advanced { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--lg-border); }
.task-create__repeat { margin: 0; padding: 0; border: 0; }
.task-create__field-error { display: block; margin-top: 4px; font-size: var(--lg-type-meta); color: var(--lg-danger); }
.task-create__draft { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.task-create__open,
#lg-shell-toast .task-create__open { margin-left: 10px; color: inherit; text-decoration: underline; white-space: nowrap; }

/* select2 — той же высоты, что и остальные поля */
.task-create .select2-container--default .select2-selection--single { display: flex; align-items: center; height: 38px; border-color: var(--lg-border); border-radius: var(--lg-radius, 8px); background: var(--lg-surface); }
.task-create .select2-container--default .select2-selection--single .select2-selection__rendered { color: var(--lg-text); line-height: 36px; }
.task-create .select2-container--default .select2-selection--single .select2-selection__arrow { height: 36px; }

/* Прямая ссылка: та же форма на странице */
.task-create-page { max-width: 680px; margin: 16px auto; background: var(--lg-surface); border: 1px solid var(--lg-border); border-radius: 14px; }
.task-create-page [data-task-create-close] { display: none; }

@media (max-width: 575.98px) {
  .lg-shell.lg-dialog.task-create-dialog { width: 100vw; max-width: 100vw; height: 100vh; height: 100dvh; max-height: none; margin: 0; border-radius: 0; }
  .task-create__grid { grid-template-columns: minmax(0, 1fr); }
  .lg-shell .task-create .task-create__body { padding: 16px; }
  .lg-shell.lg-dialog .task-create .task-create__footer { flex-direction: row; flex-wrap: nowrap; padding: 10px 16px; border-radius: 0; }
  .lg-shell.lg-dialog .task-create .task-create__footer .lg-btn { flex: 0 1 auto; width: auto; padding-inline: 10px; white-space: nowrap; }
  .lg-shell .task-create .lg-dialog-head { padding: 12px 16px; border-radius: 0; }
  .task-create-page { margin: 0; border-width: 0; border-radius: 0; }
}
