.task-attachments{min-width:0}
.task-attachments[hidden],.task-attachments [hidden]{display:none!important}
.task-attachment-heading{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:10px;min-width:0}
.task-attachment-heading h3{margin:0;font-size:13px;line-height:1.5}
.task-attachment-heading .text-link{flex:none;min-height:32px;padding:5px 0 5px 8px;color:var(--green);font-size:11px;line-height:1.4;text-align:right;cursor:pointer}
.task-attachment-heading .text-link:disabled{opacity:.55;cursor:wait}
.task-attachments .task-attachment-drop{appearance:none;display:flex;align-items:center;justify-content:flex-start;gap:12px;width:100%;min-width:0;min-height:82px;box-sizing:border-box;margin:0;padding:16px;border:1px dashed var(--line);border-color:color-mix(in srgb,var(--green) 35%,var(--line));border-radius:12px;background:var(--bg);background:color-mix(in srgb,var(--sage) 32%,var(--panel));box-shadow:none;color:var(--ink);font:inherit;line-height:1.5;text-align:left;white-space:normal;cursor:pointer;transition:border-color .15s,background-color .15s}
.task-attachment-drop>svg{display:block;box-sizing:border-box;flex:0 0 38px;width:38px;height:38px;min-width:38px;max-width:38px;max-height:38px;padding:8px;border-radius:10px;background:var(--sage);color:var(--green);fill:none;stroke:currentColor;stroke-width:1.6;stroke-linecap:round;stroke-linejoin:round;overflow:hidden}
.task-attachment-drop>span{display:grid;gap:3px;min-width:0}
.task-attachment-drop strong{color:var(--green);font-size:13px;font-weight:650;line-height:1.5;overflow-wrap:anywhere}
.task-attachment-drop small{color:var(--muted);font-size:12px;line-height:1.5;overflow-wrap:anywhere}
.task-attachments.is-dragover .task-attachment-drop{border-color:var(--green);border-style:solid;background:var(--sage);outline:3px solid color-mix(in srgb,var(--green) 18%,transparent);outline-offset:3px}
.task-attachments button:focus-visible,.task-attachments a:focus-visible{outline:3px solid var(--green);outline-offset:3px}
.task-attachments .task-attachment-drop:disabled{opacity:.6;cursor:default}
.task-attachment-hint,.task-attachment-staged{margin:8px 0 0;color:var(--muted);font-size:11px;line-height:1.65;overflow-wrap:anywhere}
.task-attachment-staged{padding-left:10px;border-left:2px solid var(--line);color:var(--green)}
.task-attachment-errors{margin:12px 0 0;padding:10px 12px;border:1px solid #ebc5bd;border-radius:9px;background:#fff2ee;color:#9f3c30;font-size:12px;line-height:1.6;white-space:pre-line;overflow-wrap:anywhere}
.task-attachment-list{display:grid;gap:8px;margin-top:12px;min-width:0}
.task-attachment-list:empty{display:none}
.task-attachment-row{display:flex;align-items:center;gap:11px;min-width:0;padding:10px;border:1px solid var(--line);border-radius:11px;background:var(--panel)}
.task-attachment-row.has-error{border-color:#d4a49a;background:color-mix(in srgb,#fff2ee 30%,var(--panel))}
.task-attachment-preview{display:block;flex:0 0 56px;width:56px;height:56px;max-width:56px;border-radius:8px;object-fit:contain;background:var(--bg);border:1px solid var(--line)}
.task-attachment-thumbnail{appearance:none;display:block;flex:0 0 56px;width:56px;height:56px;padding:0;border:0;border-radius:8px;background:var(--bg);color:var(--green);cursor:zoom-in;overflow:hidden}
.task-attachment-thumbnail .task-attachment-preview{box-sizing:border-box;width:100%;height:100%;max-width:100%}
.task-attachment-preview-fallback{display:grid;place-items:center;box-sizing:border-box;width:100%;height:100%;border:1px solid var(--line);border-radius:8px;font-size:26px}
.task-attachment-file-icon{display:grid;place-items:center;flex:0 0 42px;width:42px;height:48px;border:1px solid var(--line);border-radius:8px;background:var(--bg);color:var(--green);font-size:23px;line-height:1}
.task-attachment-info{flex:1;min-width:0;display:grid;gap:3px}
.task-attachment-name{display:block;color:var(--ink);font-size:12px;font-weight:600;line-height:1.5;overflow-wrap:anywhere;word-break:normal}
.task-attachment-open{appearance:none;width:fit-content;max-width:100%;min-height:24px;padding:0;border:0;background:none;font-family:inherit;text-align:left;cursor:zoom-in}
.task-attachment-download{justify-self:start;padding:2px 0;color:var(--green);font-size:11px;line-height:1.5;text-decoration:none;text-underline-offset:3px}
a.task-attachment-name{text-decoration:none;text-underline-offset:3px}
.task-attachment-info small{color:var(--muted);font-size:11px;line-height:1.55;overflow-wrap:anywhere;font-variant-numeric:tabular-nums}
.task-attachment-row.has-error small{color:#aa4b3e}
.task-attachment-info progress{appearance:none;display:block;box-sizing:border-box;width:100%;height:5px;margin-top:5px;accent-color:var(--green);border:0;border-radius:8px;background:var(--line);overflow:hidden}
.task-attachment-info progress::-webkit-progress-bar{background:var(--line);border-radius:8px}
.task-attachment-info progress::-webkit-progress-value{background:var(--green);border-radius:8px}
.task-attachment-info progress::-moz-progress-bar{background:var(--green);border-radius:8px}
.task-attachment-retry{justify-self:start;min-height:32px;margin-top:1px;padding:5px 0;border:0;background:none;color:var(--green);font:inherit;font-size:11px;font-weight:650;line-height:1.5;text-align:left;cursor:pointer}
.task-attachment-remove{appearance:none;display:grid;place-items:center;align-self:flex-start;flex:0 0 36px;width:36px;height:36px;padding:0;border:1px solid transparent;border-radius:8px;background:none;color:var(--muted);font:inherit;font-size:23px;line-height:1;cursor:pointer}
.task-attachment-remove:disabled{opacity:.35;cursor:wait}
.task-attachment-empty{margin:0;color:var(--muted);font-size:11px;line-height:1.6}
.task-attachment-status{margin:10px 0 0;color:var(--green);font-size:11px;line-height:1.6;overflow-wrap:anywhere}
.task-attachment-status:empty{display:none}
.task-attachments .task-export{min-height:36px;margin-top:9px;font-size:11px;line-height:1.5}
@media(hover:hover){.task-attachments .task-attachment-drop:hover:not(:disabled){border-color:var(--green);background:var(--sage)}a.task-attachment-name:hover{text-decoration:underline;color:var(--green)}.task-attachment-remove:hover:not(:disabled){border-color:var(--line);background:var(--bg);color:#a04438}.task-attachment-retry:hover{text-decoration:underline;text-underline-offset:3px}}
body.dark .task-attachment-errors{background:#382923;border-color:#70514a;color:#f0b7aa}
body.dark .task-attachment-row.has-error{background:#302c25;border-color:#70514a}
body.dark .task-attachment-row.has-error small{color:#e8b5a8}
@media(max-width:440px){.task-attachment-heading{gap:8px}.task-attachment-heading h3{font-size:13px}.task-attachment-heading .text-link{max-width:42%;min-height:40px;font-size:11px}.task-attachments .task-attachment-drop{min-height:82px;padding:13px;gap:10px}.task-attachment-drop>svg{flex-basis:36px;width:36px;height:36px;min-width:36px;max-width:36px;max-height:36px;padding:7px}.task-attachment-hint,.task-attachment-staged{font-size:11px}.task-attachment-preview{flex-basis:48px;width:48px;height:48px;max-width:48px}.task-attachment-file-icon{flex-basis:38px;width:38px;height:44px}.task-attachment-row{gap:8px;padding:9px 7px 9px 9px}.task-attachment-remove{flex-basis:40px;width:40px;height:40px}.task-attachment-retry{min-height:40px}.task-attachments .task-export{min-height:40px}}
@media(prefers-reduced-motion:reduce){.task-attachments .task-attachment-drop{transition:none}}

/* A native dialog puts the preview above the task editor without closing it. */
dialog.task-image-viewer{box-sizing:border-box;width:min(1120px,calc(100vw - 32px));max-width:calc(100vw - 32px);height:min(840px,calc(100dvh - 40px));max-height:calc(100dvh - 40px);margin:auto;padding:0;overflow:hidden;border:1px solid var(--line);border-radius:16px;background:var(--panel);color:var(--ink);box-shadow:0 24px 90px #12261c55}
dialog.task-image-viewer[open]{display:flex;flex-direction:column}
.task-image-viewer::backdrop{background:#10261ddd;backdrop-filter:blur(4px)}
.task-image-viewer [hidden]{display:none!important}
.task-image-toolbar{display:flex;align-items:center;justify-content:space-between;flex:none;gap:16px;padding:14px 18px;border-bottom:1px solid var(--line);background:var(--panel)}
.task-image-title{min-width:0;margin:0;font-size:14px;font-weight:650;line-height:1.5;overflow-wrap:anywhere}
.task-image-actions{display:flex;align-items:center;flex:none;gap:8px}
.task-image-actions .button{min-height:36px;margin:0;padding:8px 12px;font-size:12px;line-height:1.4;white-space:nowrap}
.task-image-actions .button:disabled{opacity:.5;cursor:default}
.task-image-close{appearance:none;display:grid;place-items:center;flex:0 0 40px;width:40px;height:40px;padding:0;border:1px solid transparent;border-radius:9px;background:transparent;color:var(--ink);font:inherit;font-size:28px;line-height:1;cursor:pointer}
.task-image-viewer button:focus-visible,.task-image-viewer a:focus-visible{outline:3px solid var(--green);outline-offset:2px}
.task-image-stage{position:relative;display:flex;align-items:center;justify-content:center;flex:1;min-width:0;min-height:0;overflow:auto;padding:16px;background:var(--bg)}
.task-image-full{display:block;flex:none;width:auto;height:auto;max-width:100%;max-height:100%;object-fit:contain}
.task-image-status{position:absolute;z-index:1;inset:auto 20px;margin:0 auto;max-width:440px;padding:14px 18px;border:1px solid var(--line);border-radius:10px;background:var(--panel);color:var(--muted);font-size:13px;line-height:1.65;text-align:center;overflow-wrap:anywhere}
.task-image-viewer.is-zoomed .task-image-stage{display:block}
.task-image-viewer.is-zoomed .task-image-full{max-width:none;max-height:none}
@media(hover:hover){.task-attachment-open:hover,.task-attachment-download:hover{color:var(--green);text-decoration:underline;text-underline-offset:3px}.task-attachment-thumbnail:hover{outline:2px solid var(--green);outline-offset:2px}.task-image-close:hover{border-color:var(--line);background:var(--bg)}}
@media(max-width:600px){dialog.task-image-viewer{width:calc(100vw - 16px);max-width:calc(100vw - 16px);height:calc(100dvh - 24px);max-height:calc(100dvh - 24px);border-radius:12px}.task-image-toolbar{flex-wrap:wrap;gap:8px;padding:10px 12px}.task-image-title{flex:1 1 100%;max-height:3em;overflow:hidden}.task-image-actions{width:100%;gap:8px}.task-image-actions .button{min-height:40px}.task-image-close{margin-left:auto}.task-image-stage{padding:8px}}
@media(max-width:440px){.task-attachment-thumbnail{flex-basis:48px;width:48px;height:48px}.task-attachment-download{min-height:24px}.task-image-actions .button{padding:8px 10px}}
@media(prefers-reduced-motion:reduce){.task-image-viewer::backdrop{backdrop-filter:none}}

/* Card attachments share the entire card as a drop/paste surface. */
.task-attachments-compact{margin-top:6px;padding-top:4px;border-top:1px solid var(--line);border-radius:0}
.task-attachment-compact-actions{display:flex;align-items:center;justify-content:space-between;gap:8px}
.task-attachment-compact-pick,.task-attachment-compact-refresh{appearance:none;display:inline-flex;align-items:center;justify-content:center;gap:6px;min-height:30px;padding:4px 7px;border:0;border-radius:6px;background:transparent;color:var(--muted);font:inherit;font-size:11px;line-height:1.4;cursor:pointer}
.task-attachment-compact-pick>svg{display:block;flex:none;width:15px;height:15px;fill:none;stroke:currentColor}
.task-attachment-compact-refresh{width:30px;font-size:19px}
.task-attachments-compact .task-attachment-hint{display:none;margin:2px 7px 0;font-size:10px;line-height:1.5}
.task-attachments-compact:focus-within .task-attachment-hint,.task-attachments-compact.is-dragover .task-attachment-hint,.task-attachments-compact[data-attachments-disabled=true] .task-attachment-hint{display:block}
.task-attachments-compact .task-attachment-list{grid-template-columns:repeat(2,minmax(0,1fr));align-items:start;gap:6px;margin-top:6px}
.task-attachments-compact .task-attachment-row{position:relative;grid-column:1/-1;padding:7px;gap:8px;border-radius:9px}
.task-attachments-compact .task-attachment-row.has-image{grid-column:auto;display:flex;flex-direction:column;align-items:stretch;gap:5px;padding:5px}
.task-attachments-compact .task-attachment-row.has-image:only-child{grid-column:1/-1}
.task-attachments-compact .task-attachment-thumbnail{flex:none;box-sizing:border-box;width:100%;height:auto;border-radius:6px;background:var(--bg)}
.task-attachments-compact .task-attachment-thumbnail .task-attachment-preview{width:100%;height:auto;max-width:100%;border-radius:6px}
.task-attachments-compact .task-attachment-info{gap:1px}
.task-attachments-compact .has-image .task-attachment-info{padding:0 3px 3px}
.task-attachments-compact .task-attachment-name{font-size:11px;line-height:1.4}
.task-attachments-compact .task-attachment-info small{font-size:10px;line-height:1.45}
.task-attachments-compact .has-image .task-attachment-remove{position:absolute;top:9px;right:9px;align-self:auto;flex:none;width:28px;height:28px;border:1px solid var(--line);border-radius:50%;background:var(--panel);color:var(--ink);font-size:20px;box-shadow:0 1px 5px #0002}
.task-attachments-compact .task-attachment-status{margin-top:6px;font-size:10px}
.task-attachments-compact .task-attachment-errors{padding:8px;font-size:11px}
.task-attachments-compact .task-attachment-empty{grid-column:1/-1}
.task-attachments-compact.is-dragover{outline:2px dashed var(--green);outline-offset:5px;border-radius:7px;background:var(--sage)}
@media(hover:hover){.task-attachment-compact-pick:hover:not(:disabled),.task-attachment-compact-refresh:hover:not(:disabled){background:var(--sage);color:var(--green)}}
@media(pointer:coarse),(max-width:600px){.task-attachment-compact-pick,.task-attachment-compact-refresh{min-height:40px}.task-attachment-compact-refresh{width:40px}.task-attachments-compact .has-image .task-attachment-remove{width:40px;height:40px}}
