/* 任务讨论 modal（GitHub 风格 thread）：上下文条、骨架屏、日期分隔、聊天气泡等 */
/* ═══════════════════════════════════════════
   Task Discussion modal (GitHub-style thread)
   ═══════════════════════════════════════════ */
#task-discussion-modal { z-index: var(--z-modal, 1050); }
.modal-overlay#feedback-modal, .modal-overlay#feedback-view-modal { z-index: calc(var(--z-modal, 1050) + 10); }
#task-discussion-modal .modal { width: min(1100px, calc(100vw - 32px)); max-width: 1100px; height: min(760px, calc(100vh - 40px)); max-height: 90vh; display: flex; flex-direction: column; }
.td-head { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.td-title-wrap { flex: 1; min-width: 0; }
.td-head h3 { margin-bottom: 0; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.td-title-editor { display: flex; align-items: center; gap: 5px; width: 100%; }
.td-title-editor[hidden] { display: none; }
.td-title-editor input { flex: 1; min-width: 0; height: 32px; padding: 5px 9px; border: 1px solid var(--primary); border-radius: 6px; background: var(--surface2); color: var(--text); font: inherit; font-size: 15px; font-weight: 700; }
.td-title-editor button, .td-title-edit { width: 30px; height: 30px; display: inline-grid; place-items: center; flex: 0 0 auto; padding: 0; border: 1px solid var(--border); border-radius: 6px; background: var(--surface2); color: var(--text2); cursor: pointer; font-size: 15px; }
.td-title-editor button[type="submit"] { border-color: color-mix(in srgb, var(--green) 50%, var(--border)); color: var(--green); }
.td-title-editor button:hover, .td-title-edit:hover { border-color: var(--primary); color: var(--text); }
.td-title-editor button:disabled, .td-title-editor input:disabled { cursor: wait; opacity: .6; }
.td-title-edit[hidden] { display: none; }
.td-count { font-size: 12px; color: var(--text2); white-space: nowrap; }
.td-close { background: none; border: none; color: var(--text2); font-size: 18px; cursor: pointer; padding: 2px 6px; }
.td-close:hover { color: var(--text); }
/* 任务上下文条：状态 / 优先级 / 负责人 / 截止 */
.td-context { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; font-size: 12px; color: var(--text2); padding: 6px 10px; border-radius: 8px; background: var(--surface2); border: 1px solid var(--border); }
.td-context:empty { display: none; }
.td-context-meta { width: 100%; display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.td-feedback-action { flex: 0 0 auto; min-height: 28px; margin-left: auto; padding: 5px 11px; border: 1px solid var(--primary); border-radius: 6px; background: color-mix(in srgb, var(--primary) 10%, var(--surface)); color: var(--primary-hover); font: inherit; font-size: 12px; font-weight: 700; cursor: pointer; }
.td-feedback-action:hover { background: color-mix(in srgb, var(--primary) 18%, var(--surface)); }
.td-feedback-action:focus-visible { outline: 2px solid color-mix(in srgb, var(--primary) 45%, transparent); outline-offset: 2px; }
.td-plain-task { width: 100%; }
.td-plain-task .plain-task-summary { margin: 2px 0 8px; background: color-mix(in srgb, var(--primary) 7%, var(--surface)); }
.td-plain-task .plain-task-summary-line p { font-size: 13px; line-height: 1.65; }
.td-plain-task-actions { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; padding: 0 2px 7px; }
.td-plain-task-actions details { flex: 1; min-width: 0; }
.td-plain-task-actions summary { color: var(--text2); cursor: pointer; font-size: 11px; }
.td-plain-task-actions details > div { margin-top: 7px; padding: 8px 10px; border: 1px solid var(--border); border-radius: 7px; background: var(--surface); color: var(--text2); font-size: 11px; line-height: 1.55; }
.td-plain-task-actions p { margin: 4px 0 0; }
.td-plain-task-actions button { flex: 0 0 auto; padding: 6px 9px; border: 1px solid var(--border); border-radius: 6px; background: var(--surface); color: var(--text2); cursor: pointer; font-size: 11px; }
.td-plain-task-actions button:hover { border-color: var(--primary); color: var(--primary-hover); }
.td-plain-task-actions button:disabled { cursor: wait; opacity: .65; }
.td-ctx-status { font-weight: 600; padding: 1px 8px; border-radius: 8px; color: var(--st); background: color-mix(in srgb, var(--st) 14%, transparent); }
.td-ctx-dot { width: 3px; height: 3px; border-radius: 50%; background: var(--text2); opacity: .5; }
.td-business-line { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.td-business-line > span { white-space: nowrap; }
.td-business-line select { max-width: 150px; padding: 3px 24px 3px 7px; border: 1px solid var(--border); border-radius: 6px; background: var(--surface); color: var(--text); font-size: 12px; }
.td-business-line select:disabled { opacity: .55; }
.td-assignee-picker { position: relative; }
.td-assignee-picker summary { max-width: 240px; overflow: hidden; color: var(--text2); cursor: pointer; text-overflow: ellipsis; white-space: nowrap; }
.td-assignee-menu { position: absolute; z-index: 20; top: calc(100% + 7px); left: 0; width: min(250px, calc(100vw - 56px)); max-height: 280px; overflow-y: auto; padding: 8px; border: 1px solid var(--border); border-radius: 7px; background: var(--surface); box-shadow: 0 12px 28px rgba(0,0,0,.24); }
.td-assignee-menu label { display: flex; align-items: center; gap: 8px; min-height: 34px; padding: 4px 6px; color: var(--text); cursor: pointer; }
.td-assignee-menu input { accent-color: var(--primary); }
.td-assignee-menu button { width: 100%; margin-top: 7px; padding: 7px 9px; border: 0; border-radius: 6px; background: var(--primary); color: #fff; cursor: pointer; }
.td-assignee-menu button:disabled { opacity: .6; cursor: wait; }
.td-workspace { display: grid; grid-template-columns: minmax(0, 1fr) minmax(310px, 360px); gap: 14px; flex: 1; min-height: 0; margin-top: 10px; }
.td-thread-column { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.td-checklist { position: relative; min-width: 0; min-height: 0; overflow: hidden; display: flex; flex-direction: column; border: 1px solid var(--border); border-radius: 8px; background: color-mix(in srgb, var(--surface2) 65%, transparent); }
.td-checklist-loading, .td-checklist-empty { min-height: 150px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 7px; padding: 24px; color: var(--text2); font-size: 12px; text-align: center; }
.td-checklist-generating { width: 28px; height: 28px; margin-bottom: 5px; border: 2px solid color-mix(in srgb, var(--primary) 20%, var(--border)); border-top-color: var(--primary); border-radius: 50%; animation: td-checklist-spin .8s linear infinite; }
.td-checklist-generating.small { flex: 0 0 auto; width: 16px; height: 16px; margin: 0; }
@keyframes td-checklist-spin { to { transform: rotate(360deg); } }
.td-checklist-empty strong, .td-checklist-head strong { font-size: 13px; }
.td-checklist-empty span { color: var(--text2); font-size: 11px; line-height: 1.6; }
.td-checklist-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 14px 10px; }
.td-checklist-items { min-height: 0; overflow-y: auto; padding: 0 14px; }
.td-checklist-item { display: flex; flex-direction: column; align-items: flex-start; gap: 16px; padding: 12px 0; }
.td-check-content { margin: 0; color: var(--text); font-size: 14px; line-height: 1.7; overflow-wrap: anywhere; white-space: pre-wrap; }
.td-check-refresh, .td-check-complete { border: 1px solid var(--border); border-radius: 6px; padding: 6px 10px; background: var(--surface); color: var(--text2); cursor: pointer; font: inherit; font-size: 11px; }
.td-check-refresh:hover { border-color: var(--primary); color: var(--primary); }
.td-check-refresh:disabled { opacity: .5; cursor: wait; }
.td-check-complete { border-color: var(--primary); background: var(--primary); color: #fff; font-size: 12px; }
.td-check-complete:hover { filter: brightness(1.1); }
.td-check-hint { margin: 0; padding: 4px 14px 16px; color: var(--text2); font-size: 11px; line-height: 1.6; }
/* 下一步建议 + 累积的团队 AI 成果。上下独立滚动，阅读不阻塞讨论。 */
.td-assistant-column { display: flex; flex-direction: column; gap: 12px; min-width: 0; min-height: 0; overflow-y: auto; }
.td-assistant-column > .td-checklist { flex: 0 0 auto; }
.td-assistant-column .td-checklist-items { flex: 0 0 auto; overflow: visible; }
.td-assistant-column .td-checklist-item { gap: 12px; }
.td-assistant-column .td-check-hint { padding-bottom: 12px; }
.td-ai-assessing { color: var(--text2); font-size: 11px; line-height: 1.6; }
.td-ai-offer { width: 100%; padding: 11px 12px; border: 1px solid color-mix(in srgb, var(--primary) 26%, var(--border)); border-radius: 8px; background: color-mix(in srgb, var(--primary) 6%, var(--surface)); box-sizing: border-box; }
.td-ai-offer-label { display: flex; align-items: center; gap: 7px; color: var(--primary); font-size: 12px; font-weight: 600; }
.td-ai-offer p { margin: 6px 0 10px; color: var(--text2); font-size: 11px; line-height: 1.6; overflow-wrap: anywhere; }
.td-ai-offer small { display: block; margin-top: 7px; color: var(--text2); font-size: 10px; line-height: 1.5; }
.td-ai-execute { width: 100%; min-height: 34px; padding: 7px 12px; border: 1px solid var(--primary); border-radius: 6px; background: var(--primary); color: #fff; font: inherit; font-size: 12px; font-weight: 600; cursor: pointer; }
.td-ai-execute:hover { filter: brightness(1.08); }
.td-ai-offer + .td-check-complete { border-color: var(--border); background: var(--surface); color: var(--text2); }
.td-ai-results { display: flex; flex-direction: column; flex: 1 0 320px; min-height: 320px; min-width: 0; overflow: hidden; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); }
.td-ai-results:empty { display: none; }
.td-ai-results-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-shrink: 0; padding: 13px 14px 10px; }
.td-ai-results-head strong { display: inline-flex; align-items: center; gap: 7px; color: var(--text); font-size: 13px; }
.td-ai-results-head strong span { padding: 1px 6px; border-radius: 10px; background: var(--surface2); color: var(--text2); font-size: 10px; font-weight: 500; }
.td-ai-results-head > span { display: flex; align-items: center; gap: 8px; color: var(--text2); font-size: 10px; }
.td-ai-results-head button { padding: 3px 5px; border: 1px solid var(--border); border-radius: 4px; background: var(--surface); color: var(--primary); font: inherit; cursor: pointer; }
.td-assistant-column.is-reading > .td-checklist { display: none; }
.td-assistant-column.is-reading > .td-ai-results { flex: 1 1 auto; }
.td-ai-select { display: flex; align-items: center; gap: 8px; padding: 0 14px 10px; flex-shrink: 0; }
.td-ai-select > span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
#task-discussion-modal .td-ai-select select { width: 100%; min-width: 0; height: 33px; margin: 0; line-height: 1.4; padding: 5px 26px 5px 8px; border: 1px solid var(--border); border-radius: 6px; background: var(--surface2); color: var(--text); text-overflow: ellipsis; font: inherit; font-size: 11px; }
.td-ai-report { display: flex; flex-direction: column; flex: 1; min-height: 0; overflow: hidden; padding: 0 14px; }
.td-ai-report-title { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.td-ai-report-title h4 { margin: 0; color: var(--text); font-size: 12px; line-height: 1.6; overflow-wrap: anywhere; }
.td-ai-status { flex-shrink: 0; padding: 2px 6px; border-radius: 5px; background: color-mix(in srgb, var(--green) 9%, var(--surface2)); color: var(--green); font-size: 10px; line-height: 1.6; }
.td-ai-status.is-running { color: var(--primary); background: color-mix(in srgb, var(--primary) 9%, var(--surface2)); }
.td-ai-status.is-failed { color: var(--red); background: color-mix(in srgb, var(--red) 9%, var(--surface2)); }
.td-ai-meta { margin: 4px 0 10px; color: var(--text2); font-size: 10px; line-height: 1.6; }
.td-ai-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; flex: 1; min-height: 90px; padding: 18px 14px; color: var(--text2); font-size: 11px; line-height: 1.7; text-align: center; overflow-wrap: anywhere; }
.td-ai-empty strong { color: var(--text); font-size: 12px; }
.td-ai-working .td-checklist-generating { width: 22px; height: 22px; }
.td-ai-markdown { flex: 1; min-height: 90px; overflow: auto; padding: 10px 3px 10px 0; border-top: 1px solid var(--border); color: var(--text); font-size: 12px; line-height: 1.8; overflow-wrap: anywhere; }
.td-ai-markdown .td-ai-scope { margin: 0 0 10px; padding: 8px 10px; border-left: 2px solid var(--primary); background: var(--surface2); color: var(--text2); font-size: 11px; line-height: 1.7; }
.td-ai-markdown > :first-child { margin-top: 0; }
.td-ai-markdown p { margin: 8px 0; }
.td-ai-markdown h2 { margin: 16px 0 8px; font-size: 15px; }
.td-ai-markdown h3 { margin: 13px 0 6px; font-size: 13px; }
.td-ai-markdown ul, .td-ai-markdown ol { padding-left: 20px; }
.td-ai-markdown table { width: 100%; border-collapse: collapse; font-size: 11px; }
.td-ai-markdown th, .td-ai-markdown td { padding: 6px 8px; border: 1px solid var(--border); text-align: left; }
.td-ai-markdown th { background: var(--surface2); }
.td-ai-markdown code { border-radius: 3px; background: var(--surface2); padding: 1px 4px; white-space: pre-wrap; }
.td-ai-report-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-shrink: 0; padding: 10px 0; border-top: 1px solid var(--border); }
.td-ai-report-foot > span { color: var(--text2); font-size: 10px; line-height: 1.6; }
.td-ai-delete { flex-shrink: 0; padding: 3px 0 3px 5px; border: 0; background: none; color: var(--text2); font: inherit; font-size: 10px; cursor: pointer; }
.td-ai-delete:hover { color: var(--red); }
.td-ai-notice { margin: 0 0 8px; padding: 7px 9px; border-radius: 5px; background: var(--surface2); color: var(--text2); font-size: 10px; line-height: 1.6; overflow-wrap: anywhere; }
.td-ai-results > .td-ai-notice { margin: 0 14px 8px; }
.td-ai-notice button { border: 0; background: none; color: var(--primary); font: inherit; cursor: pointer; }
.td-ai-sources { flex-shrink: 0; max-height: 120px; overflow: auto; padding: 7px 0; border-top: 1px solid var(--border); color: var(--text2); font-size: 10px; line-height: 1.7; }
.td-ai-sources summary { cursor: pointer; }
.td-ai-sources p { margin: 6px 0; overflow-wrap: anywhere; }
.td-ai-sources ul { margin: 6px 0; padding-left: 16px; }
.td-ai-sources a { color: var(--primary); overflow-wrap: anywhere; }
.td-ai-load-more { flex-shrink: 0; padding: 8px; border: 0; border-top: 1px solid var(--border); background: var(--surface2); color: var(--text2); font: inherit; font-size: 11px; cursor: pointer; }
.td-ai-load-more:hover { color: var(--primary); }
.td-ai-execute:disabled, .td-ai-delete:disabled, .td-ai-load-more:disabled { opacity: .5; cursor: wait; }
.td-ai-execute:focus-visible, .td-ai-delete:focus-visible, .td-ai-load-more:focus-visible, .td-ai-select select:focus-visible, .td-ai-markdown:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

.td-list { flex: 1; overflow-y: auto; margin: 0 0 10px; display: flex; flex-direction: column; gap: 12px; min-height: 120px; padding-right: 4px; }
.td-empty { text-align: center; padding: 32px 12px; color: var(--text); }
.td-retry-btn { margin-top: 10px; background: var(--surface2); border: 1px solid var(--border); color: var(--text); border-radius: var(--radius); padding: 6px 16px; cursor: pointer; font-size: 12px; }
.td-retry-btn:hover { border-color: var(--primary); color: var(--primary); }
/* 加载骨架 */
.td-skeleton { display: flex; flex-direction: column; gap: 14px; padding: 8px 2px; }
.td-skeleton div { height: 44px; border-radius: 10px; background: linear-gradient(90deg, var(--surface2) 25%, color-mix(in srgb, var(--text2) 12%, var(--surface2)) 50%, var(--surface2) 75%); background-size: 200% 100%; animation: td-shimmer 1.2s infinite; }
.td-skeleton div:nth-child(2) { width: 80%; }
.td-skeleton div:nth-child(3) { width: 62%; }
@keyframes td-shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
/* 日期分隔线 */
.td-day-sep { display: flex; align-items: center; gap: 10px; color: var(--text2); font-size: 11px; margin: 2px 0; }
.td-day-sep::before, .td-day-sep::after { content: ''; flex: 1; height: 1px; background: var(--border); }
/* 聊天式气泡：自己的发言靠右 */
.td-comment { display: flex; gap: 10px; max-width: 88%; }
.td-comment.own { flex-direction: row-reverse; align-self: flex-end; }
.td-avatar { width: 32px; height: 32px; border-radius: 50%; color: #fff; font-weight: 700; font-size: 14px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; margin-top: 2px; }
.td-comment-body { min-width: 0; background: var(--surface2); border: 1px solid var(--border); border-radius: 12px; border-top-left-radius: 4px; padding: 8px 12px; }
.td-comment.own .td-comment-body { border-radius: 12px; border-top-right-radius: 4px; border-color: color-mix(in srgb, var(--primary) 32%, var(--border)); background: color-mix(in srgb, var(--primary) 8%, var(--surface2)); }
.td-comment-head { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.td-comment.own .td-comment-head { flex-direction: row-reverse; }
.td-comment-author { font-weight: 600; font-size: 13px; }
.td-comment.own .td-comment-author { color: var(--primary); }
.td-comment-time { font-size: 11px; color: var(--text2); }
.td-delete-btn { margin-left: auto; background: none; border: none; color: var(--text2); font-size: 11px; cursor: pointer; padding: 2px 4px; border-radius: 4px; opacity: 0; transition: opacity .15s; }
.td-comment.own .td-delete-btn { margin-left: 0; margin-right: auto; }
.td-comment:hover .td-delete-btn { opacity: 1; }
.td-delete-btn:hover { color: var(--red); background: color-mix(in srgb, var(--red) 12%, transparent); }
.td-comment-content { font-size: 13px; line-height: 1.6; word-break: break-word; }
.td-reply-btn { background: none; border: none; color: var(--text2); font-size: 11px; cursor: pointer; padding: 2px 4px; opacity: 0; }
.td-comment:hover .td-reply-btn { opacity: 1; }
.td-reply-btn:hover { color: var(--primary); }
/* 撤回按钮：与回复/删除一致的悬停渐显，hover 时橙色高亮突出 */
.td-recall-btn { background: none; border: none; color: var(--text2); font-size: 11px; cursor: pointer; padding: 2px 4px; border-radius: 4px; opacity: 0; transition: opacity .15s; }
.td-comment:hover .td-recall-btn { opacity: 1; }
.td-recall-btn:hover { color: var(--orange, #f97316); background: color-mix(in srgb, var(--orange, #f97316) 12%, transparent); }
.td-reply-quote { width: 100%; display: flex; flex-direction: column; align-items: flex-start; gap: 2px; margin: 2px 0 6px; padding: 6px 8px; border: 0; border-left: 2px solid var(--primary); border-radius: 0; background: color-mix(in srgb, var(--primary) 7%, transparent); color: var(--text2); font: inherit; font-size: 11px; text-align: left; cursor: pointer; }
.td-reply-quote:hover { background: color-mix(in srgb, var(--primary) 13%, transparent); }
.td-reply-quote strong { color: var(--text); font-weight: 600; }
.td-reply-quote span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 420px; }
.td-file-list { display: flex; flex-direction: column; gap: 6px; margin-top: 7px; min-width: min(310px, 62vw); }
.td-file-attachment { width: 100%; min-width: 0; display: grid; grid-template-columns: 36px minmax(0, 1fr) 22px; align-items: center; gap: 9px; padding: 8px; border: 1px solid var(--border); border-radius: 6px; background: var(--surface); color: var(--text); cursor: pointer; text-align: left; }
.td-file-attachment:hover { border-color: var(--primary); background: color-mix(in srgb, var(--primary) 6%, var(--surface)); }
.td-file-badge { width: 36px; height: 36px; display: flex; align-items: center; justify-content: center; overflow: hidden; border-radius: 5px; background: color-mix(in srgb, var(--primary) 14%, var(--surface2)); color: var(--primary); font-size: 9px; font-weight: 700; }
.td-file-meta { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.td-file-meta strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; font-weight: 600; }
.td-file-meta small { color: var(--text2); font-size: 10px; }
.td-file-download { color: var(--text2); font-size: 18px; text-align: center; }
.td-composer { position: relative; display: flex; flex-direction: column; flex: 0 1 auto; min-height: 0; max-height: 65%; border-top: 1px solid var(--border); padding-top: 12px; }
.td-drop-hint { display: none; position: absolute; inset: 0; z-index: 2; flex-direction: column; align-items: center; justify-content: center; gap: 8px; border: 2px dashed var(--primary); border-radius: 8px; background: color-mix(in srgb, var(--surface) 94%, transparent); color: var(--primary); pointer-events: none; }
.td-drop-hint strong { font-size: 15px; }
.td-drop-hint span { font-size: 12px; color: var(--text2); }
.td-composer.is-dragover .td-drop-hint { display: flex; }
.td-replying-to { display: none; align-items: center; gap: 8px; padding: 6px 8px; margin-bottom: 8px; border-left: 2px solid var(--primary); background: var(--surface2); color: var(--text2); font-size: 11px; }
.td-replying-to.show { display: flex; }
.td-replying-to span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.td-replying-to button { width: 24px; height: 24px; border: 0; background: transparent; color: var(--text2); cursor: pointer; font-size: 14px; }



.td-composer textarea { flex: 0 1 auto; min-height: 88px; max-height: 320px; margin-bottom: 8px; resize: none; overflow-y: auto; line-height: 1.6; }
.td-composer-foot { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.td-attachment-btn { flex-shrink: 0; width: 34px; min-width: 34px; height: 34px; padding: 0; border: 1px solid var(--border); border-radius: 6px; background: var(--surface2); color: var(--text); cursor: pointer; font-size: 17px; }
.td-attachment-btn:hover { border-color: var(--primary); color: var(--primary); }
.td-labeled-btn, .td-library-attachment-btn { width: auto; padding: 0 9px; display: inline-flex; align-items: center; justify-content: center; gap: 5px; font-size: 12px; white-space: nowrap; }
.td-expand-btn { margin-left: auto; color: var(--text2); }
.td-attachment-btn:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.td-library-attachment-btn span[aria-hidden="true"] { font-size: 16px; }
.td-attachment-preview { min-height: 0; max-height: 126px; margin-bottom: 8px; align-items: stretch; overflow-y: auto; }
.pending-file { position: relative; width: min(260px, 100%); height: 58px; display: grid; grid-template-columns: 36px minmax(0, 1fr) 20px; align-items: center; gap: 8px; padding: 7px; border: 1px solid var(--border); border-radius: 6px; background: var(--surface2); }
.pending-file > span:nth-child(2) { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.pending-file strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; }
.pending-file small { color: var(--text2); font-size: 10px; }
.pending-file button { width: 20px; min-width: 20px; height: 20px; padding: 0; border: 0; border-radius: 4px; background: transparent; color: var(--text2); cursor: pointer; font-size: 15px; }
.pending-file button:hover { color: var(--red); background: color-mix(in srgb, var(--red) 10%, transparent); }
.td-composer-help { display: flex; align-items: center; gap: 8px; margin-top: 8px; flex-shrink: 0; }
.td-composer-hint { font-size: 11px; color: var(--text2); flex: 1; line-height: 1.6; }
.td-char-count { font-size: 11px; color: var(--orange); white-space: nowrap; }
#td-post-btn { flex-shrink: 0; background: var(--primary); color: #fff; border: none; border-radius: var(--radius); padding: 8px 20px; cursor: pointer; font-size: 13px; font-weight: 600; }
#td-post-btn:disabled { opacity: .6; cursor: default; }
#td-post-btn:hover:not(:disabled) { filter: brightness(1.08); }
#task-discussion-modal.td-editor-expanded .modal { height: calc(100vh - 40px); max-height: calc(100vh - 40px); }
.td-editor-expanded .td-workspace { grid-template-columns: minmax(0, 1fr); }
.td-editor-expanded .td-list, .td-editor-expanded .td-assistant-column, .td-editor-expanded #td-unread-jump { display: none; }
.td-editor-expanded .td-composer { flex: 1; max-height: none; }
.td-editor-expanded .td-composer textarea { flex: 1; max-height: none; }
#td-library-picker-modal, #message-image-viewer { z-index: calc(var(--z-modal, 1050) + 20); }
.td-library-picker { width: min(640px, calc(100vw - 32px)); max-width: 640px; max-height: min(720px, calc(100vh - 32px)); padding: 0; overflow: hidden; display: flex; flex-direction: column; }
.td-library-picker-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 18px 20px 13px; border-bottom: 1px solid var(--border); }
.td-library-picker-head h3 { margin: 0; font-size: 16px; }
.td-library-picker-head p { margin-top: 4px; color: var(--text2); font-size: 11px; }
.td-library-picker-close { width: 30px; height: 30px; padding: 0; border: 0; border-radius: 6px; background: transparent; color: var(--text2); cursor: pointer; font-size: 18px; }
.td-library-picker-close:hover { background: var(--surface2); color: var(--text); }
.td-library-toolbar { display: grid; grid-template-columns: minmax(0, 1fr) 132px; gap: 8px; padding: 12px 20px; border-bottom: 1px solid var(--border); }
.td-library-toolbar input, .td-library-toolbar select { width: 100%; height: 36px; min-width: 0; margin: 0; padding: 0 10px; border: 1px solid var(--border); border-radius: 6px; outline: 0; background: var(--surface2); color: var(--text); font: inherit; font-size: 12px; }
.td-library-toolbar input:focus, .td-library-toolbar select:focus { border-color: var(--primary); }
.td-library-list { min-height: 120px; max-height: 430px; flex: 1 1 220px; overflow-y: auto; padding: 0 20px; }
.td-library-row { min-height: 62px; display: grid; grid-template-columns: 18px 40px minmax(0, 1fr) auto; align-items: center; gap: 10px; border-bottom: 1px solid var(--border); cursor: pointer; }
.td-library-row:hover, .td-library-row.selected { background: color-mix(in srgb, var(--primary) 7%, transparent); }
.td-library-row.disabled { cursor: default; opacity: .48; }
.td-library-row input { width: 16px; height: 16px; accent-color: var(--primary); }
.td-library-file-icon { width: 40px; height: 40px; display: grid; place-items: center; overflow: hidden; border-radius: 6px; background: color-mix(in srgb, var(--primary) 14%, var(--surface2)); color: var(--primary); font-size: 9px; font-weight: 700; }
.td-library-file-copy { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.td-library-file-copy strong, .td-library-file-copy small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.td-library-file-copy strong { font-size: 12px; }
.td-library-file-copy small, .td-library-file-size { color: var(--text2); font-size: 10px; }
.td-library-file-size { white-space: nowrap; }
.td-library-state { min-height: 120px; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 7px; padding: 24px; color: var(--text2); font-size: 12px; text-align: center; }
.td-library-state.error { color: var(--red); }
.td-library-state button { padding: 6px 12px; border: 1px solid var(--border); border-radius: 6px; background: var(--surface2); color: var(--text); cursor: pointer; }
.td-library-load-more { align-self: center; margin: 8px 0; padding: 6px 14px; border: 1px solid var(--border); border-radius: 6px; background: transparent; color: var(--text2); cursor: pointer; font-size: 11px; }
.td-library-load-more:hover { border-color: var(--primary); color: var(--primary); }
.td-library-picker-foot { display: flex; align-items: center; justify-content: flex-end; gap: 9px; padding: 12px 20px; border-top: 1px solid var(--border); }
.td-library-picker-foot span { margin-right: auto; color: var(--text2); font-size: 11px; }
.td-library-picker-foot button { min-height: 34px; padding: 7px 14px; border: 1px solid var(--border); border-radius: 6px; background: var(--surface2); color: var(--text); cursor: pointer; }
.td-library-picker-foot button.primary { border-color: var(--primary); background: var(--primary); color: #fff; }
.td-library-picker-foot button:disabled { cursor: default; opacity: .5; }
