/* Threads panel (Nicolas, 31 October; Timeline ::AZ mock-up "Threads Panel" and "Filling A Thread").
   The approved styling comes from the mock-up harness (shot8.cjs: .thr, .thd and #threads-btn). */

/* Header: the bin moves to the far right; the Threads icon's on state uses the aqua tint. */
html body header.atelier-brand-header .header-actions #trash{order:999!important}
body.atelier-dashboard-open #threads-btn{display:none!important}
html body header.atelier-brand-header .header-actions #threads-btn.thr-on{background:#e3f5ef!important;border:1px solid #23866f!important;color:#23866f!important}
html[data-theme="dark"] body header.atelier-brand-header .header-actions #threads-btn.thr-on{background:rgba(145,217,193,.16)!important;border:1px solid #91d9c1!important;color:#91d9c1!important}

/* The panel scrolls without a bar. */
#panel:has(>#threads-root),#panel:has(>#thread-root){overflow-y:auto;scrollbar-width:none}
#panel:has(>#threads-root)::-webkit-scrollbar,#panel:has(>#thread-root)::-webkit-scrollbar{display:none}

/* The list: dense rows (about 56px) like Timelines. */
.thr .thr-top{justify-content:space-between;align-items:center}
.thr .thr-close{width:38px;height:38px;padding:0;border-radius:8px;display:grid;place-items:center;font-size:15px}
.thr #thread-name{width:100%;box-sizing:border-box}
.thr #create-thread{margin-top:10px;min-height:52px;font-size:16px;font-weight:700;border-radius:8px;background:#91d9c1!important;border:1px solid #91d9c1!important;color:#1f1e1d!important}
.thr .divider{margin:16px 0 8px!important}
.thr #thread-list{display:block;margin-top:4px}
.thr #thread-list>.timeline-item{padding:6px 0;margin:0;min-height:0}
.thr #thread-list>.timeline-item>.row{min-height:44px;margin-bottom:0;flex-wrap:nowrap;gap:10px}
.thr #thread-list>.timeline-item .timeline-title{flex-wrap:nowrap;min-width:0;flex:0 1 auto}
.thr #thread-list>.timeline-item .tl-icon{width:40px;height:40px}
.thr #thread-list>.timeline-item .title-button{font-size:14px;min-height:40px;padding:8px 12px;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.thr #thread-list>.timeline-item .title-button strong{overflow-wrap:normal}
.thr #thread-list>.timeline-item .help{font-size:13px;white-space:nowrap}
.thr #thread-list>.timeline-item .timeline-delete-button{width:40px;height:40px;padding:0!important;flex:0 0 40px;background:transparent!important;border:1px solid #d06f56!important;color:#d06f56!important}
.thr #thread-list>.timeline-item .timeline-delete-button:hover{background:rgba(208,111,86,.1)!important}
html[data-theme="dark"] .thr .tl-icon.off{opacity:.45;background:transparent!important}

/* One open thread. */
.thd{--c:#91d9c1}
.thd .td-head{display:flex;align-items:center;gap:12px;margin:10px 0 18px}
.thd .td-head h2{margin:0;font:400 30px/1.15 Georgia,serif;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;border-radius:6px;outline:none;cursor:text}
.thd .td-head h2:focus{box-shadow:0 0 0 1.5px #91d9c1;padding:0 6px;text-overflow:clip}
.thd .td-sw{flex:0 0 28px;width:28px;border-top:3px solid var(--c);border-radius:2px}
.thd .td-n{color:var(--muted);font-size:13px;margin-left:auto;white-space:nowrap}
.thd button{display:grid;place-items:center;padding:0}
.thd .td-back,.thd .td-x{flex:0 0 40px;width:40px;height:40px;border-radius:8px;border:1px solid var(--line);background:transparent;color:var(--ink);font-size:15px}
.thd svg{width:20px;height:20px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.thd .td-search{height:48px;box-sizing:border-box;border-radius:8px;border:1.5px solid #91d9c1;display:flex;align-items:center;gap:10px;padding:0 14px;color:var(--ink);font-size:15px;background:#fff;cursor:text}
.thd .td-search svg{flex:none}
html body .thd .td-search input,html body .thd .td-search input:focus,html body .thd .td-search input:focus-visible{flex:1;min-width:0;height:100%;border:0!important;outline:0!important;box-shadow:none!important;background:transparent!important;color:inherit!important;font:inherit;padding:0!important;margin:0;border-radius:0!important}
.thd .td-search input::-webkit-search-cancel-button{display:none}
.thd .td-list{margin-top:6px}
.thd .td-row{display:grid;grid-template-columns:14px minmax(0,1fr) 40px;gap:12px;align-items:center;padding:10px 4px;border-bottom:1px solid var(--line)}
.thd .td-dot{width:12px;height:12px;border-radius:50%;background:#bc664a}
.thd .td-row.in .td-dot{box-shadow:0 0 0 2px #fff,0 0 0 4px var(--c)}
.thd .td-t{min-width:0}
.thd .td-t b{display:block;font-size:15px;color:var(--ink);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.thd .td-t small{font-size:12px;color:var(--muted)}
.thd .td-b{width:40px;height:40px;border-radius:8px;border:1px solid var(--line);background:transparent;color:var(--ink)}
.thd .td-b.add{background:#e3f5ef!important;border:1px solid #23866f!important;color:#23866f!important}
.thd .td-all{width:100%;height:44px;margin-top:10px;border-radius:8px;border:1px solid #23866f;color:#23866f;background:transparent;display:flex!important;align-items:center;justify-content:center;gap:8px;font:700 15px system-ui,sans-serif}
.thd .td-all svg{width:18px;height:18px}
.thd .td-in{margin-top:26px}
.thd .td-sub{font-size:13px;color:var(--muted);padding-bottom:6px;border-bottom:1px solid var(--line)}
.thd .td-none{font-size:13px;color:var(--muted);margin:12px 4px}
html[data-theme="dark"] .thd .td-b.add{background:rgba(145,217,193,.16)!important;border-color:#91d9c1!important;color:#91d9c1!important}
html[data-theme="dark"] .thd .td-search{background:transparent;color:#efe9e2}
html[data-theme="dark"] .thd .td-back,html[data-theme="dark"] .thd .td-x,html[data-theme="dark"] .thd .td-b.rem{border-color:#3d4648;color:#efe9e2}
html[data-theme="dark"] .thd .td-all{color:#91d9c1!important;border-color:#91d9c1!important;background:transparent!important}
html[data-theme="dark"] .thd .td-row.in .td-dot{box-shadow:0 0 0 2px #1f2427,0 0 0 4px var(--c)}
html[data-theme="dark"] .thd .td-t b,html[data-theme="dark"] .thd .td-head h2{color:#efe9e2}
