.workzon-editor { min-width: 0; position: relative; border-radius: 6px; background: #fff; color: #172b26; font-weight: 400; text-transform: none; letter-spacing: 0; }
.workzon-editor .ql-toolbar { display: flex; flex-wrap: wrap; gap: 2px; padding: 6px; border-color: #d8e1df; border-radius: 6px 6px 0 0; }
.workzon-editor .ql-toolbar .ql-formats { margin: 0 4px 0 0; display: inline-flex; }
.workzon-editor .ql-toolbar button, .workzon-editor .ql-picker { width: 30px; height: 30px; min-height: 30px; padding: 5px; border: 0; border-radius: 3px; }
.workzon-editor .ql-toolbar button { color: #405750; background: transparent; }
.workzon-editor .ql-toolbar button:hover, .workzon-editor .ql-toolbar button.ql-active { background: #e1eee8; }
.workzon-editor .ql-container { height: auto; font: inherit; border-color: #d8e1df; border-radius: 0 0 6px 6px; }
.workzon-editor .ql-editor { min-height: 120px; max-height: 400px; font-size: 14px; line-height: 1.55; overflow-wrap: anywhere; }
.workzon-editor .ql-editor p { margin: 0; }
.workzon-editor .ql-editor.ql-blank::before { font-style: normal; color: #6a7c75; }
.workzon-editor .ql-toolbar .ql-picker-label { padding: 0; }
.workzon-editor .ql-tooltip { display: none !important; }
.task-comment-dock .workzon-editor .ql-editor { min-height: 60px; max-height: 150px; }
.task-drawer { display: grid; grid-template-rows: minmax(0, 1fr) auto; }
.task-drawer > .drawer-close { position: absolute; top: 12px; right: 12px; margin: 0; z-index: 10; }
#task-detail { min-height: 0; height: auto; padding-bottom: 24px; }
.task-comment-dock { position: static; }
.description-form input[name=title] { width: 100%; min-height: 38px; padding: 8px 10px; border: 1px solid #d8e1df; border-radius: 6px; font: inherit; font-size: 14px; font-weight: 400; }
.editor-picker { position: absolute; z-index: 8; top: 40px; left: 6px; width: min(340px, calc(100% - 12px)); padding: 10px; background: white; border: 1px solid #cbd8d2; border-radius: 6px; box-shadow: 0 6px 20px #0002; display: grid; grid-template-columns: 1fr 30px; gap: 8px; }
.editor-picker input { min-width: 0; }
.editor-picker-results { grid-column: 1 / -1; display: grid; max-height: 220px; overflow: auto; }
.editor-picker-results button { text-align: left; background: #fff; color: #172b26; border: 0; padding: 8px; }
.editor-picker-results button:hover { background: #e1eee8; }
.editor-picker-results [role=alert] { color: #b42318; }
.task-comment-dock .editor-picker { top: auto; bottom: calc(100% + 6px); }
.task-comment-dock .ql-picker-options { top: auto; bottom: 100%; }
.task-description-copy, .comment-body { overflow-wrap: anywhere; }
.task-description-copy p, .comment-body p, .task-system-event p { margin: 0 0 8px; }
.task-description-copy pre, .comment-body pre { white-space: pre-wrap; overflow-wrap: anywhere; padding: 10px; background: #f0f4f3; }
.task-description-copy blockquote, .comment-body blockquote { margin: 8px 0; padding: 6px 12px; border-left: 3px solid #7653aa; background: #f1eef8; }
.task-description-copy li[data-list], .comment-body li[data-list] { list-style: none; }
.task-description-copy input[type=checkbox], .comment-body input[type=checkbox] { width: 14px; height: 14px; margin-right: 8px; }
.task-settings-dialog { width: min(720px, calc(100vw - 24px)); max-height: calc(100dvh - 32px); padding: 0; border: 1px solid #ccd8d3; border-radius: 8px; color: #172b26; background: white; overflow: auto; }
.task-settings-dialog::backdrop { background: #14231e55; }
.task-settings-dialog .task-settings-section { margin: 0; padding: 20px; border: 0; background: white; }
.task-settings-dialog .section-head { position: sticky; top: 0; z-index: 1; background: white; padding-bottom: 12px; }
.task-settings-dialog [data-task-settings-close] { width: 32px; height: 32px; flex: 0 0 32px; }
.task-time-fact { font-variant-numeric: tabular-nums; }
.task-time-fact small { display: block; color: #687c72; font-size: 11px; }
.checklist .checklist-item { display: flex; align-items: center; gap: 8px; border-bottom: 1px solid #e5ece8; }
.checklist .checklist-item > [data-checklist-toggle] { flex: 1; min-width: 0; }
.checklist-actions { display: flex; gap: 4px; flex: 0 0 auto; }
.checklist .checklist-icon { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; min-width: 32px; padding: 6px; flex: 0 0 32px; border: 0; background: transparent; border-radius: 4px; }
.checklist .checklist-icon:hover { background: #e6efeb; }
.checklist .checklist-icon img { width: 16px; height: 16px; }
.checklist-undo { display: flex; gap: 12px; align-items: center; justify-content: space-between; padding: 8px 0; font-size: 12px; }
.checklist-undo span { min-width: 0; overflow-wrap: anywhere; }
.checklist-undo button { flex-shrink: 0; }
.task-plan-button { font-size: 11px; padding: 3px 0; text-align: left; }
.estimate-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.estimate-fields label { display: grid; gap: 6px; }
.estimate-fields input { width: 100%; min-width: 0; }
.estimate-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }
[data-task-estimate-form] [role=alert] { color: #b42318; }
.checklist-edit-form { display: flex; flex-wrap: wrap; gap: 6px; width: 100%; padding: 6px 0; }
.checklist-edit-form input { flex: 1 1 200px; min-width: 0; }
.checklist-edit-form [role=alert] { flex-basis: 100%; color: #b42318; }
.task-system-event { border-bottom: 1px solid #e3eae7; padding: 9px 0; color: #526a5f; font-size: 12px; }
.task-system-event summary { display: flex; gap: 10px; align-items: baseline; cursor: pointer; list-style: none; }
.task-system-event summary::before { content: '\203A'; font-size: 16px; }
.task-system-event[open] summary::before { transform: rotate(90deg); }
.task-system-event summary span { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.task-system-event time { flex-shrink: 0; font-size: 10px; }
.task-system-event > div { margin: 10px 0 6px 20px; color: #203b2c; }
.task-agent-entry { border-bottom: 1px solid #dfe6e3; padding: 10px 0; }
.task-agent-entry > summary { display: flex; align-items: baseline; gap: 10px; list-style: none; cursor: pointer; font-size: 12px; }
.task-agent-entry > summary::before { content: '\203A'; font-size: 16px; }
.task-agent-entry[open] > summary::before { transform: rotate(90deg); }
.task-agent-entry > summary > span { flex: 1; min-width: 0; }
.task-agent-entry summary strong { font-size: 12px; color: #315f9f; }
.agent-excerpt { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; overflow-wrap: anywhere; margin-top: 3px; line-height: 1.5; }
.task-agent-entry > summary time { flex-shrink: 0; font-size: 10px; color: #687c72; }
.task-agent-entry > article { margin-top: 10px; }
.task-agent-entry .comment.agent { background: #f5f8fb; }
@media(max-width: 520px) {
  .task-comment-dock { grid-template-columns: 1fr auto; }
  .task-comment-dock .comment-input-wrap { grid-column: 1 / -1; }
  .task-comment-dock .comment-attach-button { justify-self: end; }
  .task-comment-dock .workzon-editor .ql-editor { min-height: 42px; max-height: 100px; }
  .task-settings-dialog .task-field-grid, .task-settings-dialog .task-rule-grid { grid-template-columns: 1fr; }
  .task-settings-dialog .task-settings-section { padding: 14px; }
  .task-system-event summary { flex-wrap: wrap; gap: 4px 8px; }
  .task-system-event time { margin-left: 20px; }
  .task-agent-entry > summary { flex-wrap: wrap; gap: 4px 8px; }
  .task-agent-entry > summary > span { flex-basis: calc(100% - 26px); }
  .task-agent-entry > summary time { margin-left: 20px; }
}
