/* Completed tasks are folded visually; their original records stay intact. */
.task-completed-group{margin:14px 0 8px;border-top:1px solid var(--hp-border);color:var(--hp-muted)}
.task-completed-group>summary{display:flex;align-items:center;gap:9px;padding:13px 4px;cursor:pointer;list-style:none;font-size:calc(12px * var(--hp-font-scale,1));user-select:none}
.task-completed-group>summary::-webkit-details-marker{display:none}
.task-completed-group>summary:before{content:'›';font-size:20px;line-height:1;transition:transform .15s}
.task-completed-group[open]>summary:before{transform:rotate(90deg)}
.task-completed-group>summary:focus-visible{outline:3px solid var(--hp-focus-ring);outline-offset:2px;border-radius:8px}
.th-fold-mark{display:grid;place-items:center;width:20px;height:20px;background:var(--hp-soft);color:var(--hp-accent);border-radius:50%;font-size:11px}
.th-fold-count{background:var(--hp-surface2);color:var(--hp-muted);border-radius:6px;padding:1px 7px;font-size:.9em}
.th-fold-hint{margin-left:auto;font-size:.88em;color:var(--hp-muted)}
.task-completed-group[open] .th-fold-hint{font-size:0}
.task-completed-group[open] .th-fold-hint:after{content:attr(data-collapse);font-size:calc(11px * var(--hp-font-scale,1))}
.th-fold-body{padding:2px 0 5px}.th-fold-body .task-item{border-left-color:var(--hp-border)!important}
.th-history-link{display:flex;align-items:center;justify-content:space-between;gap:14px;margin:-5px 0 20px;padding:10px 14px;background:var(--hp-surface2);border-radius:10px;color:var(--hp-muted);font-size:calc(12px * var(--hp-font-scale,1));line-height:1.7}
.th-history-link button{border:0;background:none;color:var(--hp-accent);font:inherit;cursor:pointer;white-space:nowrap;padding:4px 0}
.th-history-link button>span{padding:1px 6px;border-radius:5px;background:var(--hp-soft);margin-left:4px;font-size:.9em}
.th-control{display:flex;align-items:center;gap:8px;color:var(--hp-muted);font-size:calc(12px * var(--hp-font-scale,1));min-width:0}
.th-control select{border:1px solid var(--hp-border);border-radius:8px;background:var(--hp-surface);color:var(--hp-text);font:inherit;padding:7px 8px;min-width:0;max-width:100%}
.th-history{width:100%;grid-column:1/-1;max-width:1120px;margin:8px auto 32px;font-size:calc(13px * var(--hp-font-scale,1));color:var(--hp-text);line-height:1.7}
.th-history *{box-sizing:border-box}.th-history button{font:inherit;cursor:pointer}.th-heading{display:flex;justify-content:space-between;align-items:flex-start;gap:20px;margin-bottom:20px}
.th-eyebrow{color:var(--hp-accent);font-size:.78em;letter-spacing:.09em;margin-bottom:5px!important;font-weight:600}.th-heading h3{font-size:1.9em;line-height:1.4;letter-spacing:-.02em;margin:0 0 7px;display:flex;align-items:center;gap:12px}
.th-heading h3>span{font-size:.47em;letter-spacing:0;font-weight:500;padding:3px 9px;border-radius:7px;background:var(--hp-soft);color:var(--hp-accent)}
.th-heading p{font-size:.92em;color:var(--hp-muted);margin:0;max-width:720px}.th-return{flex-shrink:0;border:1px solid var(--hp-border);background:var(--hp-surface);color:var(--hp-text);border-radius:9px;padding:9px 12px;font-size:.9em!important}
.th-history-summary{display:flex;flex-wrap:wrap;gap:8px 20px;border:1px solid var(--hp-border);background:var(--hp-surface2);border-radius:11px;padding:12px 15px;color:var(--hp-muted);font-size:.86em;margin-bottom:25px;overflow-wrap:anywhere}
.th-history-summary strong{font-weight:500;color:var(--hp-text)}.th-date-group{margin-bottom:26px}.th-date-group h4{font-size:.87em;font-weight:500;color:var(--hp-muted);margin:0 0 12px;padding-left:2px;letter-spacing:.02em}
.th-record{display:grid;grid-template-columns:24px minmax(0,1fr) auto;align-items:start;gap:13px;padding:17px 18px;background:var(--hp-surface);border:1px solid var(--hp-border);border-radius:12px;margin-bottom:9px;min-width:0}
.th-record-mark{display:grid;place-items:center;width:22px;height:22px;border-radius:50%;background:var(--hp-soft);color:var(--hp-accent);font-size:.85em;margin-top:2px}
.th-record-main{min-width:0}.th-record-context{display:flex;flex-wrap:wrap;align-items:center;gap:5px 10px;color:var(--hp-muted);font-size:.8em;overflow-wrap:anywhere;margin-bottom:4px}
.th-priority,.th-tag{padding:1px 6px;border-radius:5px;background:var(--hp-surface2)}
.th-record-title{background:none;border:0;color:var(--hp-text);font-weight:600!important;font-size:1.04em!important;padding:0;display:block;text-align:left;overflow-wrap:anywhere;line-height:1.65;max-width:100%}
.th-record-title:hover{color:var(--hp-accent)}.th-record-note{font-size:.88em;color:var(--hp-muted);margin:5px 0 9px;line-height:1.75;white-space:pre-wrap;overflow-wrap:anywhere;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;overflow:hidden}
.th-record-meta{display:flex;flex-wrap:wrap;align-items:center;gap:5px 13px;font-size:.78em;color:var(--hp-muted);margin-top:7px;overflow-wrap:anywhere}
.th-restore{font-size:.87em!important;padding:7px 10px;background:var(--hp-soft);color:var(--hp-accent);border:1px solid var(--hp-border);border-radius:8px;white-space:nowrap;margin-top:2px}
.th-restore:hover{background:var(--hp-surface2)}.th-restore:disabled{opacity:.6;cursor:wait}
.th-history button:focus-visible,.th-history-link button:focus-visible,.th-control select:focus-visible{outline:3px solid var(--hp-focus-ring);outline-offset:3px}
.th-empty{padding:45px 15px;text-align:center;border:1px dashed var(--hp-border);border-radius:12px;color:var(--hp-muted);background:var(--hp-surface)}.th-empty>span{font-size:2em;color:var(--hp-accent)}.th-empty h4{font-size:1.05em;color:var(--hp-text);margin:7px 0}.th-empty p{font-size:.9em}.th-empty button,.th-warning button{border:0;background:none;color:var(--hp-accent);padding:8px;text-decoration:underline}
.th-load-more{display:block;width:100%;border:1px solid var(--hp-border);padding:11px;background:var(--hp-surface);border-radius:9px;color:var(--hp-accent)}
.th-status{font-size:.85em;color:var(--hp-muted);min-height:25px;margin-top:14px}.th-warning{padding:11px 13px;margin-bottom:18px;background:var(--hp-soft);border-radius:9px;color:var(--hp-text);font-size:.88em}
@media(max-width:700px){.th-heading{flex-wrap:wrap;gap:12px}.th-heading h3{font-size:1.65em}.th-history-summary{gap:7px 14px;padding:10px 12px}.th-record{padding:13px 12px;gap:9px;grid-template-columns:20px minmax(0,1fr)}.th-record-mark{width:19px;height:19px}.th-restore{grid-column:2;justify-self:start;margin-top:3px}.th-history-link{align-items:flex-start;flex-wrap:wrap;gap:4px;font-size:calc(11px * var(--hp-font-scale,1))}.th-history-link>span{flex:1 1 220px}.th-fold-hint{font-size:.85em}.th-control{flex-wrap:wrap}.toolbar-search .view-switch{flex-shrink:0;max-width:100%}}
@media(prefers-reduced-motion:reduce){.task-completed-group>summary:before{transition:none}}
