/* Shared task text styles: rendered task Markdown, checklists and the rich
   editor. Used by the staff dashboard and the customer portal. Each app maps
   the --tt-* variables to its own palette. */
.task-markdown { overflow-wrap: anywhere; line-height: 1.75; }
.task-markdown a { color: var(--tt-primary-hover); text-decoration: underline; }
.task-markdown pre { background: var(--tt-panel-2); padding: 14px; border-radius: 5px; overflow-x: auto; white-space: pre; font: 12px/1.7 var(--tt-mono); }
.task-markdown code { font-family: var(--tt-mono); background: var(--tt-panel-2); padding: 1px 3px; }
.task-markdown blockquote { border-left: 3px solid var(--tt-border-strong); margin: 10px 0; padding: 0 14px; color: var(--tt-muted); }
.task-inline-media { display: block; margin: 12px 0; }
.task-inline-media img, .task-inline-media video { display: block; max-width: 100%; max-height: 640px; border-radius: 8px; }
/* Rendered task text (reading view, comments and the editor surface). */
.task-markdown { overflow-wrap: anywhere; line-height: 1.7; font-size: 13.5px; }
.task-markdown > :first-child { margin-top: 0; }
.task-markdown p { margin: 6px 0; white-space: pre-wrap; }
.task-markdown h1, .task-markdown h2 { font-size: 19px; margin: 18px 0 6px; }
.task-markdown h3 { font-size: 16px; margin: 16px 0 6px; }
.task-markdown h4 { font-size: 14px; margin: 14px 0 4px; }
.task-markdown ul, .task-markdown ol { margin: 6px 0; padding-left: 24px; }
.task-markdown li > p { margin: 2px 0; }
.task-markdown li > ul, .task-markdown li > ol { margin: 2px 0; }
.task-checklist, .task-markdown ul[data-type="taskList"] > li { list-style: none; display: flex; align-items: flex-start; gap: 8px; margin-left: -22px; }
.task-markdown ul[data-type="taskList"] { padding-left: 24px; }
.task-checklist input, .task-markdown ul[data-type="taskList"] input { width: 16px; height: 16px; margin: 4px 0 0; accent-color: var(--tt-primary); flex: none; }
.task-checklist input:not(:disabled), .task-markdown ul[data-type="taskList"] input { cursor: pointer; }
.task-markdown ul[data-type="taskList"] > li > label { flex: none; }
.task-markdown ul[data-type="taskList"] > li > div { flex: 1; min-width: 0; }
.task-markdown ul[data-type="taskList"] > li > div > p { margin: 0; }
.task-markdown ul[data-type="taskList"] > li { margin-top: 3px; margin-bottom: 3px; }
.task-markdown li[data-checked="true"] > div, .task-checklist:has(> input:checked) > span { color: var(--tt-muted); text-decoration: line-through; }
/* Rich editor */
.task-editor-wrap { position: relative; border: 1px solid var(--tt-border-strong); border-radius: 8px; background: var(--tt-bg); }
.task-editor-wrap:focus-within { border-color: var(--tt-primary); box-shadow: 0 0 0 3px var(--tt-primary-wash); }
.task-editor-tools { display: flex; align-items: center; gap: 2px; padding: 4px 6px; border-bottom: 1px solid var(--tt-border); background: var(--tt-panel); border-radius: 8px 8px 0 0; flex-wrap: wrap; }
.task-editor-tools[hidden] { display: none; }
.task-tool { display: inline-grid; place-items: center; width: 30px; height: 30px; border: 0; border-radius: 5px; background: transparent; color: var(--tt-label); cursor: pointer; padding: 0; }
.task-tool svg { width: 16px; height: 16px; }
.task-tool:hover:not(:disabled) { background: var(--tt-hover); color: var(--tt-fg); }
.task-tool[aria-pressed="true"] { background: var(--tt-primary-wash); color: var(--tt-primary-hover); }
.task-tool:disabled { opacity: .35; cursor: default; }
.task-tool:focus-visible { outline: none; box-shadow: 0 0 0 2px var(--tt-primary); }
.task-tool[hidden] { display: none; }
.task-tool-text { width: auto; padding: 0 8px; font: 600 11.5px var(--tt-sans); }
.task-tool-sep { width: 1px; height: 18px; background: var(--tt-border-strong); margin: 0 4px; }
.task-style { height: 30px; border: 0; border-radius: 5px; background: transparent; font: 600 12px var(--tt-sans); color: var(--tt-label); padding: 0 4px; cursor: pointer; }
.task-style:hover { background: var(--tt-hover); }
.task-linkbar { display: flex; align-items: center; gap: 6px; padding: 6px 8px; border-bottom: 1px solid var(--tt-border); color: var(--tt-muted); }
.task-linkbar[hidden] { display: none; }
.task-linkbar svg { width: 15px; height: 15px; flex: none; }
.task-linkbar .fin { flex: 1; min-width: 120px; min-height: 30px; padding: 4px 8px; }
.task-rich { position: relative; }
.task-rich[hidden] { display: none; }
.task-rich-content { min-height: 150px; max-height: 60vh; overflow-y: auto; padding: 12px 14px; outline: none; white-space: pre-wrap; }
.task-editor-wrap.compact .task-rich-content { min-height: 76px; max-height: 40vh; }
.task-rich-content p.is-editor-empty:first-child::before { content: attr(data-placeholder); color: var(--tt-faint); float: left; height: 0; pointer-events: none; }
.task-rich-content pre { background: var(--tt-panel-2); padding: 12px 14px; border-radius: 6px; font: 12px/1.65 var(--tt-mono); white-space: pre-wrap; }
.task-rich-content code { font-family: var(--tt-mono); background: var(--tt-panel-2); padding: 1px 4px; border-radius: 3px; font-size: .92em; }
.task-rich-content pre code { background: none; padding: 0; }
.task-rich-content a { color: var(--tt-primary-hover); text-decoration: underline; cursor: text; }
.task-rich-content .ProseMirror-selectednode { outline: 2px solid var(--tt-primary); border-radius: 4px; }
.task-rich-content .task-inline-media { display: inline-block; max-width: 100%; margin: 4px 0; }
.task-rich-content .task-inline-media img { max-height: 320px; }
.task-editor-source { display: block; width: 100%; min-height: 150px; border: 0 !important; border-radius: 0 0 8px 8px !important; box-shadow: none !important; padding: 12px 14px !important; font: 12.5px/1.7 var(--tt-mono) !important; resize: vertical; }
.task-editor-source[hidden] { display: none; }
.task-bubble { display: flex; width: max-content; gap: 2px; padding: 3px; background: var(--tt-ink); border-radius: 7px; box-shadow: var(--tt-shadow-pop); z-index: 20; }
.task-bubble .task-tool { color: var(--tt-ink-text); width: 28px; height: 28px; }
.task-bubble .task-tool:hover { background: rgba(255,255,255,.12); color: #fff; }
.task-bubble .task-tool[aria-pressed="true"] { background: rgba(255,255,255,.2); color: #fff; }
.task-slash { position: fixed; z-index: 1000; width: 260px; max-height: 280px; overflow-y: auto; padding: 4px; background: var(--tt-bg); border: 1px solid var(--tt-border); border-radius: 9px; box-shadow: var(--tt-shadow-pop); }
.task-slash-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 6px 8px; border: 0; border-radius: 6px; background: transparent; text-align: left; cursor: pointer; font: inherit; color: var(--tt-fg); }
.task-slash-item[aria-selected="true"], .task-slash-item:hover { background: var(--tt-primary-wash); }
.task-slash-item strong { display: block; font-size: 12.5px; }
.task-slash-item small { display: block; font-size: 11px; color: var(--tt-muted); }
.task-slash-icon { display: grid; place-items: center; width: 30px; height: 30px; border: 1px solid var(--tt-border); border-radius: 6px; background: var(--tt-bg); flex: none; }
.task-slash-icon svg { width: 15px; height: 15px; }
.task-slash-empty { padding: 10px; color: var(--tt-muted); font-size: 12px; }
.task-slash-num { width: auto; min-width: 30px; padding: 0 6px; font-size: 11.5px; font-weight: 650; font-variant-numeric: tabular-nums; color: var(--tt-muted); }
.task-slash-item > span:last-child { min-width: 0; }
.task-slash-item strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* Task references (#67): a link in the reading view, a chip in the editor. */
.task-markdown a.task-ref, .task-ref-chip .task-ref { color: var(--tt-primary-hover); font-weight: 600; text-decoration: none; font-variant-numeric: tabular-nums; }
.task-markdown a.task-ref:hover { text-decoration: underline; }
.task-ref-chip { padding: 0 3px; border-radius: 4px; background: var(--tt-primary-wash); }
.task-ref-chip.ProseMirror-selectednode { outline: 2px solid var(--tt-primary-hover); }

.task-inline-media.private { display: inline-flex; align-items: center; gap: 6px; margin: 4px 0; padding: 3px 10px; border: 1px dashed var(--tt-border-strong); border-radius: 99px; color: var(--tt-muted); font-size: 12px; }
.task-file-link { color: var(--tt-primary-hover); }
.task-linkbar input { font: 13px var(--tt-sans); color: var(--tt-fg); background: var(--tt-bg); border: 1px solid var(--tt-border-strong); border-radius: 5px; }
.task-linkbar input:focus { outline: none; border-color: var(--tt-primary); }
