/* Project HQ: Tasks tab, task detail panel, pop-up menus, project editor */
.ptab{background:none;border:0;border-bottom:2px solid transparent;color:var(--text-muted);font:600 13px var(--font);padding:8px 14px;cursor:pointer;margin-bottom:-1px}
.ptab:hover{color:var(--text)}
.ptab.active{color:var(--accent);border-bottom-color:var(--accent)}
.ptab .cnt{font-size:11px;font-weight:700;padding:0 6px;border-radius:4px;background:var(--surface2);border:1px solid var(--border);margin-left:4px}
.danger{color:var(--red)!important}
.danger:hover{border-color:var(--red)!important}

.tbar{display:flex;gap:7px;flex-wrap:wrap;align-items:center;margin-bottom:9px}
.tbar .form-select{max-width:190px;padding:5px 9px;font-size:12px}
.seg{display:inline-flex;gap:4px}
.tqa{display:flex;gap:7px;align-items:center;margin-bottom:10px}
.tqa .form-select{max-width:220px}

.tlist{background:var(--surface);border:1px solid var(--border);border-radius:var(--radius-lg);overflow:clip}
.tg-h{display:flex;align-items:center;gap:8px;padding:7px 10px;background:var(--surface2);border-bottom:1px solid var(--border);font-size:12px;position:sticky;top:54px;z-index:3}
.tg-h b{font-family:var(--font);font-size:15px;letter-spacing:.3px}
.tg-h .cnt,.tcol-h .cnt{font-size:11px;font-weight:700;padding:0 6px;border-radius:4px;background:var(--bg);color:var(--text-muted);border:1px solid var(--border)}
.tg-tog{background:none;border:0;color:var(--text-muted);cursor:pointer;width:18px;font-size:13px}
.tg+.tg .tg-h{border-top:1px solid var(--border)}
.tg.drop-into,.tcol.drop-into{outline:2px dashed var(--accent);outline-offset:-3px}

.trow{display:flex;align-items:center;gap:8px;padding:5px 10px 5px 4px;border-bottom:1px solid rgba(30,45,68,.5);font-size:13px;position:relative}
.tg-b .trow:last-child,.tlist>.tg:last-child .trow:last-child{border-bottom:0}
/* A work package is one row with its checklist under it (t-p14-package-back-s04) */
.tpkg{border-bottom:1px solid var(--border);border-left:3px solid var(--accent)}
.tpkg-h{display:flex;align-items:center;gap:8px;flex-wrap:wrap;padding:5px 10px 5px 4px;background:var(--accent-dim);font-size:13px}
.tpkg-h .ttl{flex:1 1 180px;min-width:0;overflow-wrap:anywhere}
.tpkg-h .tg-tog{width:32px;min-height:32px}
.tpkg-b{padding-left:14px}
.tpkg-b .trow:last-child{border-bottom:0}
.trow:hover{background:rgba(26,37,56,.6)}
.trow.sel{background:var(--accent-dim)}
.trow.focus{box-shadow:inset 3px 0 0 var(--accent)}
.trow.open{background:rgba(0,188,212,.08)}
.trow.done .ttl,.tcard.done .ttl{color:var(--text-muted);text-decoration:line-through}
.grip{width:14px;color:var(--text-dim);cursor:grab;text-align:center;user-select:none;opacity:0;font-size:11px;letter-spacing:-2px;flex-shrink:0}
.trow:hover .grip:not(.off){opacity:1}
.grip.off{cursor:default;visibility:hidden}
.tsel{width:14px;height:14px;accent-color:var(--accent);opacity:0;cursor:pointer;flex-shrink:0}
.trow:hover .tsel,.trow.sel .tsel,.tlist:has(.tsel:checked) .tsel{opacity:1}
.ttl{flex:1;min-width:0;cursor:pointer;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.tcard .ttl{white-space:normal;overflow:visible}
.ttl-edit{flex:1;min-width:0;padding:3px 8px}
.tmeta{display:flex;gap:5px;align-items:center;flex-shrink:0;max-width:55%;overflow:hidden;flex-wrap:nowrap}
.tcard .tmeta{max-width:none;flex-wrap:wrap;margin-top:6px;overflow:visible}

.pri{display:inline-flex;align-items:flex-end;gap:2px;height:14px;padding:0 2px;background:none;border:0;cursor:pointer;flex-shrink:0}
.pri i{display:block;width:3px;border-radius:1px;background:var(--text-dim);opacity:.35}
.pri i:nth-child(1){height:5px}.pri i:nth-child(2){height:9px}.pri i:nth-child(3){height:13px}
.pri.p1 i{background:var(--red);opacity:1}
.pri.p2 i{background:var(--amber);opacity:1}
.pri.p3 i:nth-child(-n+2){background:var(--accent);opacity:1}
.pri.p4 i:nth-child(1){background:var(--text-muted);opacity:1}
.pri:hover i{filter:brightness(1.4)}

.chip{display:inline-flex;align-items:center;gap:3px;font-size:11px;line-height:1.5;padding:0 7px;border-radius:10px;border:1px solid var(--border);background:var(--surface2);color:var(--text-muted);white-space:nowrap}
.chip-proj{max-width:150px;overflow:hidden;text-overflow:ellipsis}
.chip-tag{color:var(--text-muted)}
.chip-tag button{background:none;border:0;color:inherit;cursor:pointer;font-size:13px;line-height:1;padding:0 0 0 2px}
.chip-eff{font-weight:700;font-size:10px}
.cat-0{color:var(--red);background:var(--red-dim);border-color:rgba(224,53,53,.25)}
.cat-1{color:var(--amber);background:var(--amber-dim);border-color:rgba(240,165,0,.25)}
.cat-2{color:var(--green);background:var(--green-dim);border-color:rgba(34,197,94,.25)}
.cat-3{color:var(--purple);background:var(--purple-dim);border-color:rgba(168,85,247,.25)}
.cat-4{color:var(--accent);background:var(--accent-dim);border-color:rgba(0,188,212,.25)}
.cat-5{color:#06B6D4;background:rgba(6,182,212,.12);border-color:rgba(6,182,212,.25)}
.due-overdue{color:var(--red);border-color:var(--red);background:var(--red-dim)}
.due-today{color:var(--amber);border-color:var(--amber);background:var(--amber-dim)}
.due-soon{color:var(--accent)}
.avatar{display:inline-flex;align-items:center;justify-content:center;width:20px;height:20px;border-radius:50%;background:var(--accent-dim);color:var(--accent);font-size:9px;font-weight:700}

.drop-before{box-shadow:inset 0 2px 0 var(--accent)}
.drop-after{box-shadow:inset 0 -2px 0 var(--accent)}
.dragging{opacity:.4}

.tbulk{position:sticky;top:60px;z-index:6;display:flex;gap:6px;align-items:center;flex-wrap:wrap;background:var(--surface2);border:1px solid var(--accent);border-radius:var(--radius);padding:6px 10px;margin-bottom:8px;box-shadow:0 8px 24px rgba(0,0,0,.35);font-size:13px}

.tboard{display:grid;grid-auto-flow:column;grid-auto-columns:minmax(250px,1fr);gap:10px;overflow-x:auto;padding-bottom:8px;align-items:start}
.tcol{background:var(--surface);border:1px solid var(--border);border-radius:var(--radius-lg);min-width:0}
.tcol-h{display:flex;align-items:center;gap:8px;padding:9px 11px;border-bottom:1px solid var(--border)}
.tcol-h b{font-family:var(--font);font-size:15px}
.tcol-b{padding:8px;display:flex;flex-direction:column;gap:7px;min-height:70px}
.tcard{background:var(--surface2);border:1px solid var(--border);border-radius:var(--radius);padding:8px 9px;cursor:grab;font-size:13px}
.tcard:hover{border-color:var(--text-muted)}
.tcard.sel{border-color:var(--accent);background:var(--accent-dim)}
.tcard.focus{box-shadow:0 0 0 2px var(--accent)}
.tcard-t{display:flex;gap:6px;align-items:flex-start}
.tcol-empty{border:1px dashed var(--border);border-radius:var(--radius);padding:14px;text-align:center;color:var(--text-dim);font-size:12px}

.tdrawer{position:fixed;top:54px;right:0;bottom:0;width:min(440px,100vw);background:var(--surface);border-left:1px solid var(--border);z-index:120;overflow-y:auto;box-shadow:-12px 0 32px rgba(0,0,0,.35)}
.tdrawer[hidden]{display:none}
@media(min-width:1280px){.tk.with-drawer{margin-right:452px}}
.dr-h{display:flex;align-items:center;gap:8px;padding:10px 14px;border-bottom:1px solid var(--border);position:sticky;top:0;background:var(--surface);z-index:1}
.dr-b{padding:14px}
.dr-title{width:100%;background:transparent;border:1px solid transparent;border-radius:6px;color:var(--text);font:700 22px/1.25 var(--font);letter-spacing:.3px;resize:none;padding:4px 6px;margin:0 -6px 10px;outline:none;overflow:hidden}
.dr-title:hover,.dr-title:focus{border-color:var(--border);background:var(--surface2)}
.dr-grid{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin-bottom:12px}
.dr-grid label{display:flex;flex-direction:column;gap:3px;font-size:11px;color:var(--text-muted)}
.dr-grid .form-select,.dr-grid .form-input{width:100%}
.dr-lbl{display:block;font-size:11px;color:var(--text-muted);margin:10px 0 4px}
.tagedit{display:flex;flex-wrap:wrap;gap:5px;align-items:center;padding:5px 7px;border:1px solid var(--border);border-radius:6px;background:var(--surface2)}
.tag-in{flex:1;min-width:110px;background:transparent;border:0;color:var(--text);outline:none;font:inherit;font-size:12px}
.dr-detail{width:100%;min-height:150px;resize:vertical;font-size:13px;line-height:1.5;white-space:pre-wrap}
.dr-meta{margin-top:10px}
.dr-saved{min-width:40px}
@media(max-width:600px){.dr-grid{grid-template-columns:1fr}}

.popmenu{position:fixed;z-index:1700;min-width:190px;max-width:320px;overflow-y:auto;background:var(--surface2);border:1px solid var(--border);border-radius:8px;padding:4px;box-shadow:0 14px 40px rgba(0,0,0,.5)}
.popmenu-it{display:flex;align-items:center;gap:8px;width:100%;text-align:left;background:none;border:0;border-radius:6px;padding:6px 9px;color:var(--text);font:inherit;font-size:13px;cursor:pointer}
.popmenu-it:hover,.popmenu-it:focus{background:var(--accent-dim);outline:none}
.popmenu-it.on{color:var(--accent);font-weight:600}
.popmenu-it small{margin-left:auto;color:var(--text-dim)}
.popmenu-in{width:calc(100% - 8px);margin:4px}
.popmenu-sep{height:1px;background:var(--border);margin:4px 2px}

.toast-undo{pointer-events:auto;display:flex;gap:14px;align-items:center}
.khelp{display:grid;grid-template-columns:max-content 1fr;gap:7px 16px;font-size:13px;align-items:center}
.khelp kbd{font:600 11px ui-monospace,Consolas,monospace;background:var(--surface2);border:1px solid var(--border);border-radius:5px;padding:2px 7px;color:var(--accent)}
.sqlbox{background:var(--bg);border:1px solid var(--border);border-radius:var(--radius);padding:10px;max-height:340px;overflow:auto;font-size:11px;line-height:1.5;margin-bottom:10px;white-space:pre}
.lrow{display:grid;grid-template-columns:1fr 2fr auto;gap:6px;margin-bottom:5px}
.form-input.bad{border-color:var(--red)}
@media(max-width:700px){.tmeta{max-width:none;flex-wrap:wrap}.trow{flex-wrap:wrap}.tqa{flex-wrap:wrap}.lrow{grid-template-columns:1fr}}
/* project editor */
.modal:has(form.pe){max-height:92vh;overflow-y:auto;width:min(720px,94vw)}
.pe>.row{flex-wrap:wrap;align-items:flex-end;gap:10px}
.pe>.row>label{display:flex;flex-direction:column;gap:3px}
.pe>.row>label.grow{flex:1 1 200px}
.pe>.row>label input.wide,.pe>.row>label .form-input{width:100%}
.pe>.row>label input[type=number]{width:70px}

/* Task execution spec: chips, drawer sections (References, AI execution) and the Plan pill */
.chip-model{font-weight:700;font-size:10px;text-transform:uppercase;letter-spacing:.3px}
.chip-model.m-haiku{color:var(--green);background:var(--green-dim);border-color:rgba(34,197,94,.25)}
.chip-model.m-sonnet{color:var(--accent);background:var(--accent-dim);border-color:rgba(0,188,212,.25)}
.chip-model.m-opus{color:var(--purple);background:var(--purple-dim);border-color:rgba(168,85,247,.25)}
.chip-model.m-fable{color:var(--amber);background:var(--amber-dim);border-color:rgba(240,165,0,.25)}
.chip-ref{font-size:10px}
.chip-claim{color:var(--amber);border-color:rgba(240,165,0,.3)}
.dr-sec{margin-top:10px;padding-top:4px;border-top:1px solid var(--border)}
.dr-sec .dr-lbl .cnt{font-size:11px;font-weight:700;padding:0 6px;border-radius:4px;background:var(--surface2);border:1px solid var(--border)}
.refs,.refs-add,.refs-sug{display:flex;flex-direction:column;gap:4px}
.refs-add,.refs-sug{margin-top:6px}
.ref{display:flex;align-items:center;gap:6px;font-size:12px;min-width:0}
.ref .badge{flex-shrink:0;font-size:9px}
.ref-t{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--text)}
.ref-note{width:34%;min-width:80px;padding:2px 6px;font-size:11px}
.ref-sug{opacity:.72}
.ref-sug:hover{opacity:1}
.xchips{display:flex;flex-wrap:wrap;gap:4px;margin:3px 0 6px}
.xchip{font-size:10px;padding:1px 7px;border-radius:10px;border:1px solid var(--border);background:var(--surface2);color:var(--text-muted);cursor:pointer}
.xchip.on{color:var(--accent);background:var(--accent-dim);border-color:rgba(0,188,212,.35)}
.xchip.risk.on{color:var(--red);background:var(--red-dim);border-color:rgba(224,53,53,.35)}
.xrow{display:flex;align-items:center;gap:6px;margin:3px 0;min-width:0}
.xrow code{font-size:11px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;min-width:0}
.xrow .form-select,.xrow .form-input{padding:3px 6px;font-size:12px}
.xrow .grow{min-width:0}
.xlint{margin-top:8px;padding:6px 8px;border-radius:var(--radius);background:var(--surface2);border:1px solid var(--border)}
.plwave{border:1px solid var(--border);border-radius:var(--radius);padding:8px 10px;margin-top:8px}
.plwave-h{margin-bottom:4px}
.plrow{display:flex;align-items:center;gap:8px;padding:3px 0;font-size:13px;min-width:0;border-top:1px solid var(--border)}
.plrow:first-of-type{border-top:0}
.pl-t{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--text)}
.plrow .badge{flex-shrink:0}
@media(max-width:700px){.plrow .tiny.muted{display:none}}

/* Pipeline: ideas, goals, decisions, verify, Overseer, Knowledge Base */
.qopt{font-size:12px;padding:3px 0;border-top:1px solid var(--border)}
.qopt:first-of-type{border-top:0}
.qrec{border-left:3px solid var(--green);padding-left:8px}
.qwork .row{align-items:flex-end}
.vcard{margin-bottom:10px}
.vcard code{font-size:12px}
.ochain-i{margin-bottom:12px}
.ochain-g{margin:6px 0 0 14px;padding-left:10px;border-left:2px solid var(--border)}
.ochain-p{margin:6px 0 0 14px}
.ochain-p .progress-bar{margin-top:3px;height:4px}
.ofind{padding:4px 0;border-top:1px solid var(--border)}
.ofind:first-child{border-top:0}
.ofind summary{cursor:pointer}
.kbrow{padding:6px 4px;border-top:1px solid var(--border);cursor:pointer}
.kbrow:first-child{border-top:0}
.kbrow.on,.kbrow:hover{background:var(--surface2)}
.pipeline-strip .chip{background:transparent}
.plstep{display:flex;align-items:center;gap:6px;margin:4px 0;min-width:0}
.plstep .form-input,.plstep .form-select{padding:3px 6px;font-size:12px}
.plans-panel a{color:var(--text)}
.thread-row{cursor:pointer}.thread-row:hover{background:var(--surface2)}
.thread-msg{border:1px solid var(--border);border-radius:6px;padding:8px}.thread-msg.out{margin-left:24px}.thread-msg.note{border-style:dashed}
/* Intake workspace (t-p16-9kdsaa): the list on the left, the conversation on the right; stacked on a phone. */
.iw-bar{display:flex;gap:8px;align-items:center;flex-wrap:wrap;margin-bottom:6px}.iw-q{flex:1 1 240px;min-width:0}
.iw-help{margin-bottom:8px;line-height:1.45}.iw-help .err-text{margin-top:2px}
.iw-tools{margin-bottom:8px}.iw-tools>summary{cursor:pointer;padding:2px 0}
.iw-mbxrow{display:flex;flex-wrap:wrap;gap:6px 14px;align-items:baseline;margin-bottom:6px}.iw-mbx{flex:0 1 260px;min-width:0;max-width:100%}.iw-mbx[hidden]{display:none}.iw-mbxrow>.grow{flex:1 1 200px;min-width:0}
.iw-status{display:flex;flex-wrap:wrap;gap:4px 14px;align-items:baseline;margin-bottom:6px}.iw-ch{white-space:nowrap}
.iw-split{display:grid;grid-template-columns:minmax(260px,380px) minmax(0,1fr);gap:12px;align-items:start}
.iw-list,.iw-pane{min-width:0;max-height:calc(100vh - 240px);min-height:200px;overflow:auto}
.iw-list{border:1px solid var(--border);border-radius:8px;background:var(--surface)}
.iw-note{padding:6px 10px}
.iw-row{display:block;padding:8px 10px;border-top:1px solid var(--border);border-left:3px solid transparent;cursor:pointer}
.iw-row:first-child,.iw-note+.iw-row{border-top:0}.iw-row:hover{background:var(--surface2)}
.iw-row.active{background:var(--accent-dim);border-left-color:var(--accent)}
.iw-r1,.iw-r3{display:flex;align-items:center;gap:6px;min-width:0;flex-wrap:wrap}.iw-r3{margin-top:4px}
.iw-subj{flex:1 1 120px;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.iw-when{margin-left:auto;white-space:nowrap}
.iw-r2{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;margin-top:2px}
.iw-split:not([data-open="none"]) .iw-none{display:none}
@media (min-width:821px){.iw-back{display:none}}
@media (max-width:820px){
  .iw-split{grid-template-columns:minmax(0,1fr)}
  .iw-split[data-open="none"] .iw-pane,.iw-split:not([data-open="none"]) .iw-list{display:none}
  .iw-list,.iw-pane{max-height:none}
  .iw:has(.iw-split:not([data-open="none"])) :is(.iw-help,.iw-tools,.iw-mbxrow){display:none}
}
/* Intake composer (t-p16-xaqdho): the standard compose layout, labelled rows, a toolbar, a large body and the actions along the bottom. */
.cp-card{display:flex;flex-direction:column;gap:6px;min-width:0}
.cp-row{display:flex;align-items:center;gap:8px;border-bottom:1px solid var(--border);min-width:0}
.cp-lab{flex:0 0 56px;font-size:12px;color:var(--text-muted)}
.cp-in{flex:1 1 auto;min-width:0;border:0;background:transparent;color:var(--text);font-size:13px;padding:6px 2px;outline:none}
select.cp-in{background:var(--surface2);border-radius:6px;padding:6px 8px}
.cp-row:focus-within{border-bottom-color:var(--accent)}
.cp-tools{display:flex;flex-wrap:wrap;align-items:center;gap:2px}
.cp-tool{min-width:30px;min-height:28px}.cp-sep{width:1px;height:18px;background:var(--border);margin:0 4px}
.cp-linkbar{display:flex;gap:6px;align-items:center;border:1px solid var(--border);border-radius:6px;padding:2px 6px}.cp-linkbar[hidden]{display:none}
.cp-editor{min-height:260px;max-height:55vh;overflow:auto;padding:10px;border:1px solid var(--border);border-radius:6px;background:var(--surface2);line-height:1.5;outline:none;overflow-wrap:anywhere}
.cp-editor:focus{border-color:var(--accent)}
.cp-editor p{margin:0 0 .6em}.cp-editor ul,.cp-editor ol{margin:0 0 .6em 1.4em}
.cp-editor blockquote{margin:0 0 .6em;padding-left:10px;border-left:3px solid var(--border);color:var(--text-muted)}
.cp-editor a{color:var(--accent);text-decoration:underline}
.cp-sig-ed{min-height:60px;max-height:160px;margin:4px 0}
.cp-plain{min-height:140px}
.cp-bottom{display:flex;flex-wrap:wrap;align-items:center;gap:6px;border-top:1px solid var(--border);padding-top:8px}
@media (max-width:820px){.cp-lab{flex-basis:48px}.cp-editor{min-height:200px;max-height:45vh}.cp-bottom .btn{flex:1 1 auto}}
.cp-tools .cp-canned{margin-left:auto;max-width:100%}
/* Verify and the plans bar at phone width: a long select or a long check command wraps inside its box instead of running past it (t-p14-package-back-s04 UX check) */
.filter-bar .form-select,.ps-bar .form-select{max-width:100%}
.vcard label.small.row>span,.vcard label.small.row code{min-width:0;max-width:100%;overflow-wrap:anywhere;white-space:normal}
