/* Search transcripts — web/search.js.
   A whole-screen panel like Drafts and History, and laid out like them: a head,
   then a single readable column. Only the shared tokens are used, so the panel
   follows whatever the theme does to them. */

.sx {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
}
/* Not optional: `display: flex` above beats the `hidden` attribute on its own. */
.sx[hidden] { display: none; }


.sx-bar {
    flex: none;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 4px 28px 16px;
    max-width: 860px;
}
.sx-field {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 9px;
    height: 38px;
    padding: 0 14px;
    border-radius: var(--pill);
    background: var(--s2);
    box-shadow: inset 0 0 0 1px var(--outline-soft);
    color: var(--text-3);
    transition: box-shadow var(--t-fast) var(--ease);
}
.sx-field:focus-within { box-shadow: inset 0 0 0 1px var(--outline); }
.sx-field input {
    flex: 1;
    min-width: 0;
    background: none;
    border: 0;
    outline: 0;
    color: var(--text);
    font: 400 var(--fs-base)/1 var(--sans);
}

.sx-toggle {
    flex: none;
    height: 34px;
    padding: 0 14px;
    border-radius: var(--pill);
    background: var(--s2);
    color: var(--text-3);
    font: 500 var(--fs-sm)/1 var(--sans);
    transition: background var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
}
.sx-toggle:hover { background: var(--s3); color: var(--text-2); }
.sx-toggle.on { background: var(--sel-bg); color: var(--sel-fg); }

.sx-body {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 0 28px 32px;
    max-width: 860px;
}
.sx-list { display: flex; flex-direction: column; gap: 10px; }

.sx-note { padding: 18px 4px; }
.sx-note p { margin: 0; max-width: 520px; font-size: var(--fs-md); line-height: 1.65; color: var(--text-2); }

.sx-pending {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 4px 4px;
    font-size: var(--fs-sm);
    color: var(--text-3);
}
.sx-pending .dash-btn { margin-left: 0; height: 28px; }

/* One card per session. The left edge takes the project's colour when it has
   one — the same signal the rail uses — and the quietest surface when not. */
.sx-session {
    border-radius: var(--r-lg);
    background: var(--s1);
    box-shadow: inset 3px 0 0 var(--sx-proj, var(--s5));
    padding: 10px 12px 8px 16px;
}
.sx-session-head {
    display: flex;
    align-items: baseline;
    gap: 10px;
    min-width: 0;
    padding: 2px 4px 6px;
}
.sx-session-title {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-align: left;
    background: none;
    padding: 0;
    color: var(--text);
    font: 500 var(--fs-base)/1.4 var(--sans);
}
.sx-session-title:hover { color: var(--blue); }
.sx-session-meta {
    flex: none;
    margin-left: auto;
    font-size: var(--fs-sm);
    color: var(--text-4);
    white-space: nowrap;
}

.sx-hits { display: flex; flex-direction: column; }
.sx-hit {
    display: grid;
    grid-template-columns: 52px minmax(0, 1fr) auto;
    align-items: baseline;
    gap: 10px;
    width: 100%;
    padding: 6px 4px;
    border-radius: var(--r-sm);
    background: none;
    text-align: left;
    color: var(--text-2);
    transition: background var(--t-fast) var(--ease);
}
.sx-hit:hover { background: var(--s2); }
.sx-hit:focus-visible { outline: 1px solid var(--outline); outline-offset: -1px; }
.sx-hit-kind {
    font: 500 var(--fs-xs)/1.6 var(--sans);
    color: var(--text-4);
}
.sx-hit[data-kind="user"] .sx-hit-kind { color: var(--blue); }
.sx-hit[data-kind="tool"] .sx-hit-text { font: 400 var(--fs-sm)/1.55 var(--mono); }
.sx-hit-text {
    font-size: var(--fs-md);
    line-height: 1.55;
    overflow: hidden;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    overflow-wrap: anywhere;
}
/* The matched words. The same amber find-in-conversation paints with, so the
   two searches read as one idea at two sizes. */
.sx-hit-text mark {
    background: var(--q-flash-tint, var(--s4));
    color: var(--yellow);
    border-radius: 2px;
}
.sx-hit-when { font-size: var(--fs-xs); color: var(--text-4); white-space: nowrap; }
.sx-more { margin: 2px 0 2px 66px; font-size: var(--fs-sm); color: var(--text-4); }
