.task-detail-pairs{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:12px;padding:12px 14px}
#task-drawer .task-detail-pairs>.field-row{display:flex;flex-direction:column;align-items:stretch;gap:6px;padding:0;margin:0;min-width:0}
.task-detail-pairs .drawer-assignee-person{min-width:0;max-width:100%}
.task-detail-pairs select,.task-detail-pairs input{width:100%;min-width:0;max-width:100%}
.description-file-list{display:flex;gap:8px;flex-wrap:wrap;margin-top:8px}.description-file-list button{max-width:100%;overflow-wrap:anywhere}
.wb-crop-dialog{position:fixed;inset:0;z-index:100000;background:#0009;display:grid;place-items:center;padding:18px}.wb-crop-card{background:var(--surface,#fff);color:var(--text,#111);padding:20px;border-radius:16px;width:min(420px,100%);max-height:90dvh;overflow:auto}.wb-crop-preview{width:min(100%,260px);margin:0 auto;aspect-ratio:1;display:block;border-radius:50%;touch-action:none;cursor:grab;user-select:none;-webkit-user-select:none}.wb-crop-card label{display:block;margin:12px 0}.wb-crop-card input{width:100%}.wb-crop-actions{display:flex;justify-content:flex-end;gap:8px}

.description-attachment{display:inline-flex;flex-direction:column;gap:4px;max-width:100%;margin:8px 8px 0 0;overflow-wrap:anywhere}.description-attachment img{max-width:220px;max-height:180px;object-fit:contain;border-radius:8px}


.wb-crop-preview.is-dragging{cursor:grabbing}.wb-crop-help{text-align:center;margin:16px 0 20px}.wb-crop-touch{display:none}@media(pointer:coarse){.wb-crop-touch{display:inline}.wb-crop-desktop{display:none}}

#task-drawer .task-detail-pairs > #drawer-priority-field { grid-column: 1; grid-row: 3; }
#task-drawer .assignee-search-trigger { display: flex; align-items: center; gap: 8px; min-height: 38px; padding: 4px 10px; text-align: left; }
#task-drawer .assignee-search-trigger #drawer-assignee-photo { display: inline-flex; flex: 0 0 28px; width: 28px; height: 28px; }
#task-drawer .assignee-search-trigger .person-avatar { flex: 0 0 28px; width: 28px; height: 28px; }
#task-drawer .assignee-trigger-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.assignee-search-panel [role="option"] { display: flex; align-items: center; gap: 10px; }
.assignee-search-panel .assignee-option-avatar, .assignee-search-panel .assignee-option-avatar .person-avatar { display: inline-flex; flex: 0 0 30px; width: 30px; height: 30px; }
.assignee-search-panel .assignee-option-avatar .person-avatar, #task-drawer .assignee-search-trigger .person-avatar { display: inline-grid; place-items: center; text-align: center; }

.search-assignee { display:inline-flex;align-items:center;gap:6px;font-size:12px;color:var(--muted);margin:3px 0; }
.search-assignee .person-avatar { display:inline-grid;place-items:center;width:24px;height:24px;flex:0 0 24px;font-size:10px; }
#drawer-priority[data-priority="high"] { color:var(--red); background:var(--red-bg); }
#drawer-priority[data-priority="medium"] { color:var(--amber); background:var(--amber-bg); }
#drawer-priority[data-priority="low"] { color:var(--green); background:var(--green-bg); }
#drawer-due[data-due-state~="due-overdue"] { color:var(--red); border-color:var(--red); }
#drawer-due[data-due-state~="due-today"] { color:var(--green); border-color:var(--green); }
#drawer-due[data-due-state~="due-tomorrow"] { color:var(--amber); border-color:var(--amber); }

/* Task text and inline description presentation. */
#drawer-desc[hidden],#drawer-desc-links[hidden]{display:none!important}
#drawer-desc-links{border:1px solid var(--border,#444);border-radius:6px;padding:10px;min-height:110px;overflow-wrap:anywhere}
#drawer-desc-links .description-rendered{white-space:normal;line-height:1.55}
#drawer-desc-links>.link-btn{margin-top:10px}
.comment-edit-form textarea{overflow:hidden;max-height:none!important;resize:vertical;box-sizing:border-box}
#drawer-activity .comment-body,#drawer-activity .activity-group-entry{font-weight:600}
.image-viewer-controls{display:flex;gap:6px;flex-wrap:wrap;justify-content:center}.image-viewer-footer{flex-wrap:wrap}

/* Inline document layout, matching the supplied reference. */
#drawer-desc-links.description-content{border:1px solid var(--border,#444);min-height:170px;padding:16px 10px;line-height:1.65;white-space:pre-wrap;cursor:text;font-weight:400}
#drawer-desc-links:focus{outline:1px solid var(--primary,#6aa8ff);outline-offset:1px}
#drawer-desc-links a:not(.description-image-download){color:#70a9ff}
#drawer-desc-links .description-image-block{display:block;position:relative;max-width:100%;margin:18px 0 24px;padding-right:28px;white-space:normal}
#drawer-desc-links .description-image-block>a:first-child{display:block}
#drawer-desc-links .description-inline-image{display:block;width:auto;max-width:100%;height:auto;max-height:520px;object-fit:contain;border-radius:5px}
#drawer-desc-links .description-image-download{position:absolute;right:36px;top:8px;background:#292929;color:#ddd;border-radius:10px;padding:6px 12px;text-decoration:none;font-size:20px;line-height:1.3}
#drawer-desc-links .description-remove-image{position:absolute;right:0;top:4px;font-size:22px;color:#aaa;padding:0 3px;line-height:1.3}
#drawer-desc-links:empty:before{content:attr(data-placeholder);color:var(--muted,#888);pointer-events:none}


 #drawer-desc-links .description-image-download,#drawer-desc-links .description-remove-image{opacity:0;pointer-events:none;transition:opacity .12s}
 #drawer-desc-links .description-image-block:hover .description-image-download,#drawer-desc-links .description-image-block:hover .description-remove-image,#drawer-desc-links .description-image-block:focus-within .description-image-download,#drawer-desc-links .description-image-block:focus-within .description-remove-image{opacity:1;pointer-events:auto}
#drawer-desc-links .description-type-line{display:block;min-height:30px;cursor:text;white-space:pre-wrap;position:relative}
#drawer-desc-links .description-type-line:has(>br:only-child):before{content:'Type here…';color:var(--muted,#888);pointer-events:none;position:absolute;left:0;top:0}
#drawer-desc-links:focus .description-type-line:before{content:none}

#drawer-desc-links.description-content{display:block}
#drawer-desc-links .description-type-line{width:100%}

/* Keep long subtask lists visible, full width, and clearly separated by completion state. */
#drawer-subtasks{display:grid;gap:7px;width:100%;min-width:0;}
.subtask-add-row{display:flex;justify-content:flex-end;align-items:center;margin-top:10px;}
#drawer-subtasks .subtask-row{display:flex;align-items:center;width:100%;min-width:0;box-sizing:border-box;gap:10px;padding:10px;border:1px solid var(--border,#444);border-radius:8px;background:var(--surface-2,#222);}
#drawer-subtasks .subtask-row.done{border-left:4px solid var(--green,#42b883);background:color-mix(in srgb,var(--green-bg,#18372c) 70%,transparent);}
#drawer-subtasks .subtask-title{flex:1;min-width:0;overflow-wrap:anywhere;}
#drawer-subtasks .subtask-row.done .subtask-title{color:var(--muted,#888);text-decoration:line-through;}
#drawer-subtasks .subtask-state{flex:0 0 auto;padding:3px 7px;border-radius:999px;background:var(--surface,#111);color:var(--muted,#aaa);font-size:11px;font-weight:650;white-space:nowrap;}
#drawer-subtasks .subtask-row.done .subtask-state{background:var(--green-bg,#18372c);color:var(--green,#42b883);}
#drawer-subtasks .subtask-actions{display:inline-flex;flex:0 0 auto;align-items:center;gap:5px;}
#drawer-subtasks .subtask-edit{border:1px solid var(--border,#444);border-radius:6px;background:transparent;color:var(--text,#eee);font:inherit;font-size:12px;padding:4px 8px;cursor:pointer;}
#drawer-subtasks .subtask-edit:hover{border-color:var(--primary,#70a9ff);}
@media(max-width:520px){#drawer-subtasks .subtask-row{flex-wrap:wrap;}#drawer-subtasks .subtask-title{flex-basis:calc(100% - 32px);}#drawer-subtasks .subtask-state{margin-left:26px;}#drawer-subtasks .subtask-actions{margin-left:auto;}}

/* Keep task dialogs inside narrow phone viewports and let the action row wrap instead of clipping. */
#modal-backdrop{box-sizing:border-box;padding:max(12px,env(safe-area-inset-top,0px)) max(12px,env(safe-area-inset-right,0px)) max(12px,env(safe-area-inset-bottom,0px)) max(12px,env(safe-area-inset-left,0px));overflow-x:hidden;overflow-y:auto;}
#modal{box-sizing:border-box;width:min(420px,100%);max-width:100%;min-width:0;max-height:calc(100dvh - 24px);overflow-x:hidden;overflow-y:auto;}
#modal input,#modal select,#modal textarea{box-sizing:border-box;width:100%;max-width:100%;min-width:0;}
#modal textarea.subtask-modal-input{display:block;min-height:92px;padding:10px 12px;line-height:1.45;resize:vertical;white-space:pre-wrap;overflow-wrap:anywhere;}
#modal .modal-actions{display:flex;flex-wrap:wrap;align-items:center;gap:8px;}
#modal .modal-actions .btn{display:inline-flex;align-items:center;justify-content:center;min-height:42px;flex:0 1 auto;white-space:nowrap;}
#modal .subtask-modal-actions .btn-primary{min-width:120px;font-size:14px;font-weight:700;visibility:visible;opacity:1;}
@media(max-width:420px){#modal .modal-actions{justify-content:stretch;}#modal .modal-actions .btn{flex:1 1 120px;}#modal .subtask-modal-actions .btn-primary{flex-basis:140px;}}



