/* Project search in the top toolbar. Results open as a dropdown over the page;
   it closes when focus and pointer leave the search area and reopens on focus. */
.search-form { display:flex; min-width:0; }
.search-form input { flex:1; min-width:0; min-height:36px; padding:7px 12px; border-right:0; border-radius:var(--radius-control) 0 0 var(--radius-control); }
.search-form input:focus-visible { position:relative; z-index:1; }
.search-form .button { min-height:36px; border-radius:0 var(--radius-control) var(--radius-control) 0; background:var(--surface-hover); border-color:var(--line-strong); }
.search-form .button:hover { background:var(--line); }

.search-panel { position:absolute; z-index:30; top:calc(100% + 6px); left:0; right:0; max-height:min(480px,70vh); overflow:auto; background:var(--surface); border:1px solid var(--line-strong); border-radius:var(--radius-control); }
.search-panel:has(> .help[hidden]):has(> .search-results:empty),
.project-search:not(:focus-within):not(:hover) .search-panel { display:none; }
.search-panel>.help { margin:0; padding:9px 14px; font-size:12px; border-bottom:1px solid var(--line); }
.search-results { margin:0; padding:0; list-style:none; }
.search-results li+li { border-top:1px solid var(--line); }
.search-hit { display:grid; gap:2px; width:100%; padding:10px 14px; border:0; background:transparent; color:var(--ink); text-align:left; }
.search-hit:hover { background:var(--surface-hover); }
.search-hit:focus-visible { outline-offset:-2px; background:var(--surface-hover); }
.search-hit strong { font-size:13.5px; font-weight:560; overflow-wrap:anywhere; }
.search-kind { font-size:12px; color:var(--muted); }
.search-snippet { font-size:12.5px; line-height:1.5; color:var(--muted); overflow-wrap:anywhere; white-space:pre-wrap; display:-webkit-box; -webkit-line-clamp:3; -webkit-box-orient:vertical; overflow:hidden; }

/* Usage totals (.usage-summary/.usage-people) are styled in activity.css next to usage.js. */

/* Runs detail: interactive session controls (controls.js) and the isolated
   worktree section (worktrees.js). Provider phase, last turn outcome, control
   holder and input delivery are separate facts with separate treatments. */
.session-status { display:flex; flex-wrap:wrap; align-items:center; gap:6px 18px; margin:6px 0 4px; font-size:13px; }
.session-phase { display:inline-flex; align-items:center; gap:8px; font-weight:550; }
.session-phase::before { content:""; width:8px; height:8px; border-radius:50%; flex-shrink:0; border:1.5px solid var(--faint); }
.session-phase:is([data-phase="starting"],[data-phase="working"])::before { background:var(--agent); border-color:var(--agent); animation:pulse 1.6s ease-in-out infinite; }
.session-phase[data-phase="ready"]::before { border-color:var(--agent); }
.session-phase[data-phase="waiting_permission"] { color:var(--human); }
.session-phase[data-phase="waiting_permission"]::before { background:var(--human); border-color:var(--human); }
.session-phase[data-phase="unknown"] { color:var(--uncertain); }
.session-phase[data-phase="unknown"]::before { background:var(--hatch); border:1px solid var(--uncertain); }
.session-outcome { padding:1px 8px; border-radius:999px; background:var(--surface-hover); color:var(--muted); font-size:12px; }
.session-holder { color:var(--muted); }
.session-controls .message { margin:10px 0; }
.session-controls>div>.help:first-of-type { margin-top:14px; }
.session-lease { margin:12px 0 4px; }
.session-controls textarea { min-height:80px; margin:8px 0 10px; }
.session-permission { margin:14px 0; padding:12px 14px; border-left:3px solid var(--human); border-radius:0 var(--radius-control) var(--radius-control) 0; background:var(--human-soft); }
.session-permission-kind { font-size:12px; color:var(--human); }
.session-permission h4 { margin:4px 0 6px; font-size:14px; font-weight:600; }
.session-permission pre { max-height:220px; overflow:auto; margin:0 0 10px; padding:10px 12px; border-radius:var(--radius-control); background:var(--code); font-size:12px; line-height:1.6; white-space:pre-wrap; overflow-wrap:anywhere; }
.session-subhead { margin:16px 0 4px; font-size:13px; font-weight:550; color:var(--muted); }
.session-subhead:has(+ .control-history:empty) { display:none; }
.control-history { margin:0; padding:0; list-style:none; }
.control-history>li { padding:9px 0; border-top:1px solid var(--line); font-size:13px; }
.control-input-head { display:flex; flex-wrap:wrap; align-items:center; gap:4px 10px; }
.control-input-head strong { font-weight:560; }
.control-input-text { margin-top:4px; max-width:75ch; color:var(--muted); white-space:pre-wrap; overflow-wrap:anywhere; }
.control-history .help { margin-top:2px; }
.delivery { display:inline-flex; align-items:center; gap:6px; padding:1px 8px 1px 7px; border-radius:999px; font-size:12px; font-weight:550; background:var(--surface-hover); color:var(--muted); }
.delivery::before { content:""; width:7px; height:7px; border-radius:50%; flex-shrink:0; border:1.5px solid currentColor; }
.delivery-queued,.delivery-sending { background:var(--agent-soft); color:var(--agent); }
.delivery-sending::before { background:currentColor; animation:pulse 1.6s ease-in-out infinite; }
.delivery-acknowledged { background:var(--done-soft); color:var(--done); }
.delivery-acknowledged::before { background:currentColor; }
.delivery-written { padding:0 7px 0 6px; background:transparent; color:var(--ink); border:1px solid var(--line-strong); }
.delivery-rejected { background:var(--danger-bg); color:var(--danger); }
.delivery-rejected::before { background:currentColor; }
.delivery-uncertain { background:var(--uncertain-soft); color:var(--uncertain); }
.delivery-uncertain::before { background:var(--hatch); border-width:1px; }

.worktree-option { margin-top:10px; }
.worktree-option>input { margin:8px 0 0; }
.worktree-option>.help { margin:4px 0 0 24px; }
.run-worktree .run-meta { padding:6px 0 4px; }
.run-worktree dd.mono { font-family:var(--font-mono); }
.worktree-branch { font-size:13px; font-weight:500; color:var(--muted); }
.run-worktree .button { margin-top:10px; }

.worktree-merge h4 { margin:12px 0 4px; font-size:13px; font-weight:600; }
.worktree-review-list { margin:0; padding:0 0 0 18px; font-size:13px; line-height:1.6; overflow-wrap:anywhere; }
.worktree-review-list code,.worktree-review-list .mono,.worktree-commit { font-family:var(--font-mono); font-size:12px; }
.worktree-commit { overflow-wrap:anywhere; }
.worktree-merge-actions { display:flex; flex-wrap:wrap; gap:8px; }
.worktree-strategy .help { margin:0 0 6px 24px; }
.worktree-merge>div>input { margin:0 0 4px; }
