.task-workspace{--tw-muted:var(--ink-secondary)}

.tw-scopes{display:flex;flex-wrap:wrap;gap:var(--space-2);margin:0 0 var(--space-3)}

.tw-scope{border:1px solid var(--line);border-radius:var(--radius-control);background:var(--surface);color:var(--ink-secondary);padding:var(--space-2) var(--space-3);font-size:var(--text-sm);line-height:1.5;min-height:40px;cursor:pointer}

.tw-scope:hover{background:var(--surface-hover);border-color:var(--border-strong)}

.tw-scope.active{color:var(--primary-ink);border-color:var(--border-strong);background:var(--primary-soft);font-weight:600}

.tw-scope:focus-visible,.tw-project-link:focus-visible,.tw-complete:focus-visible{outline:3px solid var(--primary);outline-offset:3px}

.tw-scope-note{font-size:var(--text-xs);line-height:1.75;color:var(--tw-muted);margin:0 0 var(--space-5);overflow-wrap:anywhere}

.tw-filters{display:grid;grid-template-columns:minmax(200px,1.5fr) minmax(170px,1fr) minmax(160px,1fr);gap:var(--space-3);align-items:end}

.tw-filter{display:flex;flex-direction:column;gap:var(--space-2);min-width:0}

.tw-filter>span{font-size:var(--text-xs);font-weight:600;color:var(--ink-secondary)}

.tw-filter .filter-input,.tw-filter .filter-select{width:100%;min-width:0;height:40px;max-width:100%;box-sizing:border-box;flex:0 0 auto}

.tw-result-count{font-size:var(--text-xs);line-height:1.7;color:var(--tw-muted);margin:var(--space-3) 0 var(--space-4);overflow-wrap:anywhere}

.tw-groups{display:flex;flex-direction:column;gap:var(--space-5);min-width:0}

.tw-project{border:1px solid var(--line);border-radius:var(--radius-card);background:var(--surface);overflow:hidden;min-width:0}

.tw-project-header{display:flex;align-items:center;justify-content:space-between;gap:var(--space-4);padding:var(--space-4) var(--space-5);background:var(--surface-subtle);border-bottom:1px solid var(--line)}

.tw-project-identity{display:flex;align-items:center;gap:var(--space-3);min-width:0}

.tw-project-logo{width:70px;height:42px;flex-shrink:0;border:1px solid var(--border);border-radius:var(--radius-control);background:var(--surface-subtle);display:inline-flex;align-items:center;justify-content:center;color:var(--ink-secondary);font-size:var(--text-md);font-weight:700;overflow:hidden;padding:var(--space-2);box-sizing:border-box}

.tw-project-logo img{display:block;max-height:100%;width:100%;object-fit:contain}

.tw-project-logo.tw-logo-dark{background:var(--brand-ink);border-color:var(--brand-ink)}

.tw-unassigned-logo{width:42px}

.tw-unassigned-logo svg{width:21px;height:21px}

.tw-project-heading{min-width:0}

.tw-project-heading h2{margin:0 0 var(--space-1);font-size:var(--text-md);line-height:1.5;color:var(--ink);overflow-wrap:anywhere}

.tw-project-link{border:0;background:none;color:var(--ink);font:inherit;font-weight:650;padding:0;line-height:inherit;text-align:left;cursor:pointer;overflow-wrap:anywhere}

.tw-project-link:hover{color:var(--primary-ink);text-decoration:underline;text-underline-offset:3px}

.tw-project-count{font-size:var(--text-xs);color:var(--tw-muted)}

.tw-project-header>.btn{flex-shrink:0}

.tw-unassigned-note{margin:0;padding:var(--space-3) var(--space-5) 0;color:var(--tw-muted);font-size:var(--text-xs);line-height:1.75;overflow-wrap:anywhere}

.tw-task-list{list-style:none;margin:0;padding:0 var(--space-5)}

.tw-task{display:flex;align-items:flex-start;gap:var(--space-3);padding:var(--space-4) 0;border-bottom:1px solid var(--border);min-width:0}

.tw-task:last-child{border-bottom:0}

.tw-complete-area{width:44px;min-height:44px;flex-shrink:0;display:flex;align-items:flex-start;justify-content:center;cursor:pointer}

.tw-complete{width:19px;height:19px;margin:var(--space-1) 0 0;accent-color:var(--primary);cursor:pointer;flex-shrink:0}

.tw-complete:disabled{cursor:wait}

.tw-task-main{flex:1;min-width:0;padding-top:1px}

.tw-task-title{display:flex;align-items:flex-start;gap:var(--space-2);flex-wrap:wrap;min-width:0}

.tw-task-title .title-link{font-size:var(--text-sm);line-height:1.8;text-align:left;overflow-wrap:anywhere;max-width:100%}

.tw-task-meta{display:flex;align-items:center;gap:var(--space-1) var(--space-4);flex-wrap:wrap;margin-top:var(--space-1);font-size:var(--text-xs);line-height:1.8;color:var(--tw-muted);min-width:0}

.tw-deadline,.tw-owner{display:inline-flex;align-items:flex-start;gap:var(--space-1);min-width:0;max-width:100%;overflow-wrap:anywhere}

.tw-deadline svg,.tw-owner svg{width:13px;height:13px;flex-shrink:0;margin-top:2px}

.tw-overdue{color:var(--danger)}

.tw-due-today{color:var(--primary-ink);font-weight:600}

.tw-owner .title-link{font-size:var(--text-xs);font-weight:500;line-height:1.8;overflow-wrap:anywhere;white-space:normal}

.tw-task-actions{display:flex;flex-direction:column;align-items:flex-end;gap:var(--space-2);flex-shrink:0;max-width:220px}

.tw-task-chips{display:flex;align-items:center;justify-content:flex-end;gap:var(--space-2);flex-wrap:wrap}

.tw-task-actions>.btn{font-size:var(--text-xs)}

.tw-groups>.empty{border:1px solid var(--line);border-radius:var(--radius-card);background:var(--surface);padding:var(--space-8) var(--space-5)}

@media(max-width:1000px){.tw-task{flex-wrap:wrap}
.tw-task-actions{width:100%;max-width:none;flex-direction:row;align-items:center;justify-content:space-between;margin-left:56px}
.tw-task-chips{justify-content:flex-start}
}

@media(max-width:720px){.tw-filters{grid-template-columns:repeat(2,minmax(0,1fr))}
.tw-search-filter{grid-column:1/-1}
.tw-project-header{align-items:flex-start;flex-wrap:wrap;padding:var(--space-4) var(--space-4)}
.tw-project-header>.btn{margin-left:83px}
.tw-task-list{padding:0 var(--space-4)}
.tw-unassigned-note{padding-left:var(--space-4);padding-right:var(--space-4)}
.tw-project-logo{width:70px}
.tw-unassigned-logo{width:42px}
.tw-task-title .title-link{font-size:var(--text-sm)}
.tw-scope{min-height:44px}
}

@media(max-width:420px){.tw-filters{grid-template-columns:minmax(0,1fr)}
.tw-search-filter{grid-column:auto}
.tw-scopes{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:var(--space-2)}
.tw-scope{padding:var(--space-2) var(--space-2);font-size:var(--text-xs)}
.tw-project-header{gap:var(--space-3)}
.tw-project-header>.btn{margin-left:0;min-height:40px}
.tw-project-identity{width:100%;gap:var(--space-3)}
.tw-project-heading h2{font-size:var(--text-sm)}
.tw-task{gap:var(--space-2)}
.tw-task-actions{margin-left:53px;align-items:flex-start;flex-wrap:wrap;gap:var(--space-2)}
.tw-task-actions>.btn{min-height:40px}
.tw-task-title .title-link{line-height:1.65}
.tw-task-meta{gap:var(--space-1) var(--space-2)}
.tw-project-count{line-height:1.7}
}

/* Match the application's mobile layout, including touch-device landscape. */
@media(max-width:800px),(max-width:1024px) and (hover:none){.tw-scope,.tw-project-link,.tw-project-header>.btn,.tw-task-actions>.btn{min-height:44px;min-width:44px}
}

/* Dashboard cards share one spacing scale: 8 / 16 / 24 px. */
.dashboard-projects{--tw-muted:var(--ink-secondary);--project-gutter:24px;min-width:0}

.dashboard-projects>.card-heading{margin-bottom:var(--space-2);gap:var(--space-4);flex-wrap:wrap}

.dashboard-projects>.card-heading .actions{gap:var(--space-2)}

.dashboard-projects-note{font-size:var(--text-sm);color:var(--tw-muted);line-height:1.7;margin:0 0 var(--space-6)}

.dashboard-project{margin-bottom:var(--space-6)}

.dashboard-project:last-child{margin-bottom:0}

.dashboard-project .tw-project-header{padding:16px var(--project-gutter);gap:var(--space-4);flex-wrap:wrap}

.dashboard-project .tw-project-identity{gap:var(--space-4)}

.dashboard-project .tw-project-logo{width:72px;height:40px}

.dashboard-project .tw-project-count{font-size:var(--text-xs);line-height:1.6}

.dashboard-project-meta{display:flex;align-items:center;gap:var(--space-2);flex-wrap:wrap}

.dashboard-project .project-disclosure-actions{gap:var(--space-2)}

.dashboard-project .project-disclosure-actions>.btn{min-height:36px}

.dashboard-project-task-list{padding:0 var(--project-gutter)}

.dashboard-project .task-row{display:grid;grid-template-columns:24px minmax(0,1fr) 200px;align-items:start;gap:var(--space-3);padding:var(--space-4) 0;min-height:76px}

/* The generic compact list removes its last bottom padding; full project cards must retain it. */
.dashboard-project .task-row:last-child{padding-bottom:var(--space-4);border-bottom:0}

.dashboard-project .task-check{width:24px;height:24px;margin:0}

.dashboard-project .task-body .title-link{font-size:var(--text-sm);line-height:24px;white-space:normal;overflow-wrap:anywhere;text-align:left}

.dashboard-project .task-meta{margin-top:var(--space-1);font-size:var(--text-xs);line-height:20px;gap:var(--space-2)}

.dashboard-project .task-meta:empty{display:none}

.dashboard-project .task-date{width:100%;font-size:var(--text-xs);line-height:20px;text-align:right;white-space:normal;overflow-wrap:anywhere}

.dashboard-project .task-date>div{display:flex;justify-content:flex-end;gap:var(--space-2);flex-wrap:wrap}

.dashboard-project-empty{padding:24px var(--project-gutter);margin:0;color:var(--tw-muted);font-size:var(--text-sm);line-height:1.7}

.project-disclosure-summary{display:flex;align-items:center;justify-content:space-between;gap:var(--space-4);min-height:56px;padding:var(--space-4) var(--space-5);cursor:pointer;list-style:none;background:var(--surface-subtle)}

.project-disclosure-summary::-webkit-details-marker{display:none}

.project-disclosure-summary h2,.project-disclosure-summary h3{margin:0;font-size:var(--text-md);line-height:1.5;color:var(--ink);overflow-wrap:anywhere}

.project-disclosure-summary:focus-visible{outline:3px solid var(--primary);outline-offset:-3px}

.project-disclosure-arrow{width:9px;height:9px;border-right:2px solid var(--ink-secondary);border-bottom:2px solid var(--ink-secondary);transform:rotate(-45deg);flex-shrink:0;margin-right:var(--space-1)}

.project-disclosure[open]>.project-disclosure-summary{border-bottom:1px solid var(--line)}

.project-disclosure[open]>.project-disclosure-summary .project-disclosure-arrow{transform:rotate(45deg)}

.dashboard-project.project-disclosure>.project-disclosure-body{padding:0}

.dashboard-project>.project-disclosure-summary{padding:16px var(--project-gutter)}

.project-disclosure-actions{flex-wrap:wrap;justify-content:flex-end}

.detail-text.task-checklist{white-space:normal;max-height:none;overflow:visible}

.task-checklist-status{font-size:var(--text-sm);color:var(--muted);margin-bottom:var(--space-3)}

.task-checklist-fields{border:0;padding:0;margin:0;min-width:0}

.task-note-prose{white-space:pre-wrap;overflow-wrap:anywhere;min-height:1.7em}

.task-note-item{display:grid;grid-template-columns:20px minmax(0,1fr);align-items:start;gap:var(--space-3);min-height:44px;padding:var(--space-2) 0;cursor:pointer;line-height:1.7}

.task-note-item input{width:20px;height:20px;margin:2px 0 0;accent-color:var(--blue);cursor:pointer}

.task-note-item span{white-space:pre-wrap;overflow-wrap:anywhere}

.task-note-done span{color:var(--muted);text-decoration:line-through}

.task-checklist-fields:disabled .task-note-item{cursor:wait;opacity:.7}

.task-checklist-error:empty{display:none}

.task-checklist-error{margin-top:var(--space-3);color:var(--danger)}

.task-checklist-error p{margin:0 0 var(--space-2);overflow-wrap:anywhere}

@media(max-width:720px){.project-disclosure-summary{padding:var(--space-3) var(--space-4)}
.project-disclosure .tw-project-identity{width:auto}
.project-disclosure-actions{justify-content:flex-start}
}

@media(max-width:800px),(max-width:1024px) and (hover:none){
  .dashboard-projects{--project-gutter:16px}

  .dashboard-project .task-row{grid-template-columns:44px minmax(0,1fr);gap:var(--space-2) var(--space-3)}

  .dashboard-project .task-check{width:44px;height:44px;grid-row:1/3}

  .dashboard-project .task-body{padding-top:var(--space-2)}

  .dashboard-project .task-date{grid-column:2;text-align:left}

  .dashboard-project .task-date>div{justify-content:flex-start}

  .dashboard-project .project-disclosure-actions>.btn{min-height:44px}

}

@media(max-width:600px){
  .dashboard-projects>.card-heading .actions{flex-wrap:wrap}

  .dashboard-project .project-disclosure-actions{width:100%;justify-content:flex-start}

}
