/* Tasks: a single compact header and clear, full-width project sections. */
.tasks-workspace-header { gap: 16px; }
.tasks-workspace-header .task-scope-tabs { margin-right: auto; flex-shrink: 0; }
.tasks-workspace-header .task-scope-tabs .tab { padding: 7px 13px; white-space: nowrap; font-size: 14px; }
.tasks-content.content-pad.work-content { padding-top: 12px; }
.task-list .task-group-heading th { padding: 12px 0 0; border: 0; background: transparent; }
.task-list .task-group-toggle { width: 100%; padding: 10px 12px; gap: 9px; border: 1px solid #dce6f1; border-radius: 8px; background: #edf3fa; color: #354e69; transition: background .15s; }
.task-list .task-group-toggle:hover { background: #e3edf7; }
.task-list .task-group-count { margin-left: 2px; min-width: 22px; padding: 1px 6px; text-align: center; font-size: 12px; font-weight: 500; border-radius: 5px; background: #fff; color: #617388; }

/* Assigned checklist steps link to their original task without duplicating it. */
.checklist-task-link { display: flex; flex-direction: column; gap: 5px; padding: 8px 0; }
.checklist-parent-caption { display: flex; align-items: flex-start; gap: 5px; color: #6a8097; font-size: 12px; line-height: 1.45; }
.checklist-parent-caption svg { width: 14px; height: 14px; flex: 0 0 14px; margin-top: 1px; }
.checklist-parent-caption>span { min-width: 0; overflow-wrap: anywhere; }
.checklist-parent-caption>svg:last-child { margin-left: auto; width: 12px; flex-basis: 12px; }
.checklist-task-link:hover .checklist-parent-caption { color: #087f75; }
.is-complete .checklist-task-link { text-decoration: none; }
.is-complete .checklist-list-title { text-decoration: line-through; }
.checklist-project-link,.checklist-list-value { font-size: 14px; line-height: 1.45; color: #596d86; padding: 4px; overflow-wrap: anywhere; }
.checklist-project-link { text-align: left; border-radius: 6px; }
.checklist-project-link:hover { color: #087f75; background: #edf4fd; }
.checklist-inherited { display: flex; flex-direction: column; gap: 2px; }
.checklist-inherited small { font-size: 11px; color: #7a8b9e; }
.task-list .checklist-priority { display: inline-flex; align-items: center; border-radius: 6px; padding: 4px 9px; height: auto; min-height: 30px; color: #596d86; }
.task-detail .checklist-row.checklist-target { background: #e8f5ee; border-radius: 7px; outline: 2px solid #9fc7b8; outline-offset: 3px; }

/* Details: title, properties, and useful content without form scaffolding. */
.drawer.task-detail { width: min(1020px,calc(100% - 40px)); max-height: 92dvh; border-radius: 18px; }
.task-detail .task-detail-header { padding: 25px 28px 20px; gap: 16px; align-items: flex-start; flex-shrink: 0; max-height: 40dvh; overflow-y: auto; }
.task-title-block { display: flex; align-items: flex-start; gap: 9px; min-width: 0; flex: 1; }
.task-detail .task-title-block h2 { font-size: 24px; line-height: 1.35; letter-spacing: -.55px; font-weight: 600; margin: 0; overflow-wrap: anywhere; }
.task-detail .task-edit-button,.task-detail .task-close { width: 32px; height: 32px; min-width: 32px; flex-shrink: 0; border-radius: 8px; color: #74869b; }
.task-detail .task-edit-button:hover,.task-detail .task-close:hover { color: #087f75; background: #edf3fa; }
.task-detail .task-edit-button svg { width: 18px; height: 18px; }
.task-detail .drawer-content { padding: 0 28px 24px; min-height: 0; }
.task-properties { display: grid; grid-template-columns: 1.35fr 1.25fr 1.15fr 1.05fr 1fr; gap: 12px; margin-bottom: 24px; }
.task-property { min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.task-property .field-label { font-size: 12px; color: #617388; margin: 0; }
.task-property .portal-control { min-width: 0; width: 100%; min-height: 40px; font-size: 14px; border-radius: 8px; padding: 9px 10px; }
.task-property .status-select { background: #e7eff7; color: #354e69; border-color: #ceddeb; }
.task-assignee { display: flex; align-items: center; min-width: 0; gap: 5px; padding-left: 9px; border: 1px solid #d6e1ef; border-radius: 8px; background: #f1f6fc; }
.task-assignee .avatar { flex-shrink: 0; width: 24px; height: 24px; }
.task-assignee .portal-control { flex: 1; width: 0; border: 0; background: transparent; padding: 9px 7px 9px 0; min-height: 38px; }
.task-detail-columns { display: grid; grid-template-columns: 1.35fr 1fr; gap: 26px; align-items: start; }
.task-detail-main,.task-checklist,.task-description { min-width: 0; }
.task-section-heading { display: flex; align-items: center; gap: 9px; min-height: 32px; margin: 0 0 10px; }
.task-section-heading h3 { font-size: 16px; font-weight: 600; margin: 0; }
.task-description .task-section-heading { justify-content: space-between; }
.task-description-text { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 15px; line-height: 1.7; padding: 15px 17px; border: 1px solid #e0e8f2; border-radius: 10px; background: #f6f9fd; }
.task-description-text.is-empty { color: #74869b; }
.task-checklist-count { font-size: 12px; color: #617388; background: #edf3fa; border-radius: 5px; padding: 3px 7px; }
.task-detail .checklist-row { display: flex; align-items: flex-start; gap: 10px; padding: 7px 0; margin: 0; font-size: 15px; line-height: 1.5; }
.task-detail .checklist-row input { margin: 2px 0 0; flex-shrink: 0; }
.task-detail .checklist-row .checklist-item-text { overflow-wrap: anywhere; min-width: 0; }
.task-detail .checklist-add { display: flex; gap: 5px; margin-top: 12px; border: 1px solid #d6e1ef; border-radius: 9px; padding: 3px; background: #fff; }
.task-detail .checklist-add:focus-within { border-color: #65b5af; box-shadow: 0 0 0 3px #087f7510; }
.task-detail .checklist-add input { flex: 1; width: 0; min-width: 0; border: 0; box-shadow: none; background: transparent; padding: 7px 8px; font-size: 14px; }
.task-detail .checklist-add input:focus-visible { outline: 0; }
.task-detail .checklist-add button { flex-shrink: 0; color: #087f75; }
.task-attachments { margin-top: 14px; }
.task-detail .attachment-row { gap: 8px; padding: 10px 0; }
.task-detail .attachment-row span { overflow-wrap: anywhere; min-width: 0; }
.task-upload { display: flex; align-items: center; text-align: left; gap: 11px; width: 100%; padding: 12px 14px; border: 1px dashed #bdcfe0; border-radius: 9px; color: #4c6884; background: #fbfcfe; }
.task-upload:hover { background: #edf5fa; border-color: #77a8b7; }
.task-upload>svg { width: 19px; height: 19px; flex-shrink: 0; }
.task-upload>svg:last-child { margin-left: auto; width: 16px; }
.task-upload span { font-size: 14px; line-height: 1.45; }
.task-upload small { display: block; color: #77899d; font-size: 12px; margin-top: 2px; }
.task-detail .drawer-footer { padding: 16px 28px; border-top: 1px solid #e4ebf3; flex-shrink: 0; }
.task-detail .drawer-footer .btn { font-size: 14px; padding: 9px 15px; }
.task-detail .drawer-footer .btn.primary { margin-left: auto; }
.task-detail .drawer-footer svg { width: 17px; height: 17px; }
.task-text-editor { width: 100%; min-width: 0; }
.task-text-editor textarea { display: block; width: 100%; max-width: 100%; min-height: 140px; max-height: 320px; padding: 12px 14px; resize: vertical; background: #f6f9fd; border: 1px solid #9ebacb; border-radius: 10px; color: #233548; font: inherit; font-size: 15px; line-height: 1.6; }
.task-text-editor.title-editor textarea { min-height: 84px; font-size: 22px; font-weight: 600; line-height: 1.4; }
.task-edit-actions { display: flex; gap: 6px; margin-top: 9px; }
.task-detail .task-link-source { margin: -6px 0 18px; }

/* Feedback belongs near the actions, without permanently occupying the footer. */
#toast { left: auto; right: 24px; bottom: 24px; transform: translateY(8px); max-width: min(420px,calc(100vw - 32px)); background: #fff; color: #233548; border: 1px solid #d7e5e8; border-left: 3px solid #087f75; border-radius: 11px; padding: 13px 18px; box-shadow: 0 8px 32px #18344b20; font-size: 14px; line-height: 1.5; transition: opacity .18s,transform .18s; z-index: 120; }
#toast.visible { transform: translateY(0); }

@media(max-width:1100px) {
 .tasks-workspace-header { height: auto !important; min-height: 58px; flex-wrap: wrap; padding-top: 9px !important; padding-bottom: 9px !important; gap: 9px; }
 .tasks-workspace-header .topbar-right { margin-left: auto; }
}
@media(max-width:900px) {
 .task-properties { grid-template-columns: repeat(3,minmax(0,1fr)); }
 .task-detail-columns { grid-template-columns: 1.15fr 1fr; gap: 20px; }
}
@media(max-width:700px) {
 .tasks-workspace-header .task-scope-tabs { order: 3; width: 100%; display: grid; grid-template-columns: 1fr 1.4fr 1fr; }
 .tasks-workspace-header .task-scope-tabs .tab { padding: 7px 4px; white-space: normal; font-size: 13px; line-height: 1.3; }
 .tasks-workspace-header .topbar-right { flex: 0 0 auto; }
 .task-list .task-group-heading th { padding-top: 12px; }
 .task-list .task-group-toggle { padding: 10px; }
 .drawer.task-detail { width: calc(100% - 20px); max-height: 94dvh; }
 .task-detail .task-detail-header { padding: 18px 18px 16px; gap: 5px; }
 .task-detail .task-title-block h2 { font-size: 21px; letter-spacing: -.35px; }
 .task-title-block { gap: 3px; }
 .task-detail .drawer-content { padding: 0 18px 20px; }
 .task-properties { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; margin-bottom: 20px; }
 .task-property:first-child { grid-column: 1 / -1; }
 .task-detail-columns { grid-template-columns: minmax(0,1fr); gap: 20px; }
 .task-detail .drawer-footer { padding: 12px 18px; gap: 8px; }
 .task-detail .drawer-footer .btn { padding: 9px 11px; font-size: 13px; }
 .task-text-editor.title-editor textarea { font-size: 20px; }
 #toast { right: 16px; bottom: 16px; }
}
@media(prefers-reduced-motion:reduce) { #toast,.task-list .task-group-toggle { transition: none; } }

/* Independent checklist ownership: a small person control with the shared picker. */
.task-detail .checklist-row { align-items: center; gap: 8px; }
.checklist-item-label { display: flex; align-items: flex-start; gap: 10px; flex: 1; min-width: 0; cursor: pointer; }
.task-detail .checklist-row.checked .avatar,.task-detail .checklist-row.checked .avatar span { text-decoration: none; }
.task-detail .checklist-row .checklist-owner.portal-control { display: flex; justify-content: center; width: 32px; height: 32px; min-height: 32px; flex: 0 0 32px; padding: 2px; border: 1px dashed #bdcfe0; background: #f7fafd; border-radius: 50%; color: #74869b; }
.task-detail .checklist-owner.portal-control:has(.avatar) { border-style: solid; border-color: transparent; background: transparent; }
.task-detail .checklist-owner.portal-control:hover { border-color: #65aaa5; background: #edf7f5; }
.checklist-owner.portal-control>.avatar { width: 28px; height: 28px; border: 0; }
.checklist-owner.portal-control>svg { width: 18px; height: 18px; }
.portal-control .visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.control-option .control-person,.control-option .control-person .avatar { width: 28px; height: 28px; flex: 0 0 28px; }
.control-option>.control-person+span { flex: 1; }

/* Task conversation reuses the same author, mention, reaction and editing controls. */
.task-detail .task-discussion { margin-top: 26px; padding-top: 20px; border-top: 1px solid #e0e8f2; }
.task-discussion>.task-section-heading>.btn { margin-left: auto; }
.task-discussion .task-comment { position: relative; display: flex; gap: 11px; padding: 13px 14px; margin: 0; border-radius: 9px; border: 0; scroll-margin: 18px; }
.task-discussion .task-comment:hover { background: #f7f9fc; }
.task-discussion .task-comment.own-message { background: #f1f6fc; }
.task-discussion .task-comment.mention-unread { background: #eff8e9; box-shadow: inset 3px 0 #92bd72; }
.task-discussion .task-comment.message-target { outline: 2px solid #8fb8b3; outline-offset: 2px; }
.task-discussion .task-comment>.avatar { width: 36px; height: 36px; flex: 0 0 36px; border: 0; border-radius: 9px; }
.task-discussion .message-meta { flex-wrap: wrap; gap: 7px; margin-bottom: 4px; }
.task-discussion .message-meta strong { font-size: 15px; font-weight: 600; }
.task-discussion .message-meta time { font-size: 12px; color: #76869a; }
.task-discussion .message-text { max-width: none; margin: 0; font-size: 15px; line-height: 1.6; white-space: pre-wrap; overflow-wrap: anywhere; }
.task-discussion .message-actions { margin-top: 7px; gap: 9px; min-height: 0; flex-wrap: wrap; }
.task-discussion .message-actions:empty { display: none; }
.task-discussion .reply-link { display: inline-flex; align-items: center; gap: 5px; font-size: 13px; }
.task-discussion .reply-link svg { width: 15px; height: 15px; }
.task-discussion .task-comment-group+.task-comment-group { margin-top: 13px; }
.task-discussion .task-replies { margin: 7px 0 0 31px; padding-left: 12px; border-left: 2px solid #dfe8f2; }
.task-discussion .task-replies .task-comment+.task-comment { margin-top: 5px; }
.task-discussion .task-replies .reaction-avatars .avatar { width: 19px; height: 19px; }
.task-discussion .task-inline-reply { margin: 10px 0 0 45px; }
.task-reply-caption { display: flex; align-items: center; justify-content: space-between; color: #617388; font-size: 12px; }
.task-reply-caption .icon-btn { width: 26px; height: 26px; }
.task-discussion .composer-wrap { padding: 14px 0 0; }
.task-inline-reply .composer-wrap { padding-top: 4px; }
.task-discussion .composer { padding: 11px 13px; border-radius: 10px; }
.task-discussion .composer textarea { font-size: 15px; line-height: 1.5; min-height: 48px; padding: 0; }
.task-discussion .composer-footer { margin-top: 7px; }
.task-discussion .composer-hint { font-size: 11px; }
.task-discussion .send-btn { width: 34px; height: 32px; }
.task-discussion .discussion-empty { margin: 0; padding: 8px 0; font-size: 14px; color: #74869b; line-height: 1.6; }

/* Task mentions stay in Tasks, with a direct link to the exact comment. */
.list-switch .task-mentions-toggle { display: inline-flex; align-items: center; gap: 7px; padding: 7px 10px; border: 1px solid #dce6f1; border-radius: 8px; color: #526e87; font-size: 13px; }
.list-switch .task-mentions-toggle[aria-expanded=true] { background: #eaf4f2; border-color: #a3c9c3; color: #087f75; }
.task-mentions-toggle>span:first-child { font-size: 17px; }
.task-mentions-toggle [data-task-mention-count] { border-radius: 10px; padding: 1px 6px; background: #dfeecd; color: #48632d; font-size: 11px; }
.task-mentions-panel { margin: 0 0 16px; border: 1px solid #dce6f1; border-radius: 10px; max-height: 330px; overflow: auto; }
.task-mentions-heading { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; padding: 12px 14px; background: #f3f7fc; font-size: 13px; }
.task-mentions-heading>span { color: #74869b; font-size: 12px; }
.task-mention-entry { display: flex; width: 100%; gap: 11px; align-items: flex-start; padding: 12px 14px; text-align: left; border-top: 1px solid #e6edf5; }
.task-mention-entry:hover { background: #f3f7fc; }
.task-mention-entry.is-unread { background: #f4f9ee; }
.task-mention-entry>.avatar { width: 34px; height: 34px; flex: 0 0 34px; }
.task-mention-copy { display: grid; gap: 3px; flex: 1; min-width: 0; font-size: 12px; color: #74869b; }
.task-mention-copy strong { color: #233548; font-size: 14px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.task-mention-copy .task-mention-excerpt { color: #52677d; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.task-mention-entry>time { font-size: 11px; line-height: 1.6; color: #74869b; white-space: nowrap; }
.task-mention-dot { width: 7px; height: 7px; flex: 0 0 7px; border-radius: 50%; background: #83a55d; margin-top: 5px; }
.task-mentions-empty { margin: 0; padding: 16px; font-size: 14px; line-height: 1.6; color: #74869b; }
.sidebar [data-nav=tasks] .overdue-count:has(+.mention-count) { margin-right: 5px; }
.sidebar [data-nav=tasks] .overdue-count+.mention-count { margin-left: 0; }
@media(min-width:701px) {
 .sidebar-collapsed .sidebar [data-nav=tasks] .overdue-count:has(+.mention-count) { top: auto; bottom: 0; right: 2px; }
}
@media(max-width:700px) {
 .task-discussion .task-replies { margin-left: 14px; padding-left: 8px; }
 .task-discussion .task-inline-reply { margin-left: 14px; }
 .task-discussion .task-comment { padding: 12px 9px; gap: 8px; }
 .task-discussion .task-comment>.avatar { width: 28px; height: 28px; flex-basis: 28px; }
 .task-discussion .message-meta strong { font-size: 14px; }
 .task-discussion .composer-hint { max-width: 200px; }
 .tasks-content .list-switch { gap: 8px; flex-wrap: wrap; }
 .task-mentions-heading>span { display: none; }
}
