.query-highlight {
    position: absolute;
    display: flex;
    align-items: center;
    overflow: hidden;
    white-space: pre;
    pointer-events: none;
    color: var(--text);
}
.query-highlight > span { display: block; flex: 0 0 auto; }
#searchInput.query-colored-input { color: transparent; caret-color: var(--text); }
#searchInput.query-colored-input::placeholder { color: var(--text-secondary); }
#searchInput.query-colored-input::selection { background: var(--izi-primary-bg); }
/* Fields, logical operators and values each have one consistent color. */
.query-token-tag,
.query-token-flag,
.query-token-identity,
.query-token-type,
.query-token-date { color: var(--izi-diff-added); }
.query-token-operator { color: var(--izi-diff-modified); }
/* The negation stands apart from AND and OR: an excluding criterion must not
   read as one more alternative. Typed `-` is shown as `NOT` (see the grammar). */
.query-token-not { color: var(--izi-diff-removed); }
.query-token-quoted { color: var(--text); }
.query-composing .query-highlight { visibility: hidden; }
.query-composing #searchInput.query-colored-input { color: var(--text); }
@media (forced-colors: active) {
    .query-highlight { display: none; }
    #searchInput.query-colored-input { color: FieldText; caret-color: FieldText; }
}
.filter-reset-btn {
    display: inline-flex; align-items: center; justify-content: center;
    flex-shrink: 0; width: var(--izi-control-height, 36px); min-height: var(--izi-control-height, 36px);
    padding: 6px; border: 1px solid var(--border); border-radius: 6px;
    background: var(--bg); color: var(--text); cursor: pointer;
}
.filter-reset-btn:disabled { opacity: .4; cursor: default; }
.filter-reset-btn:not(:disabled):hover { background: var(--izi-primary-bg); }
.izi-ctx-shortcut-row { display: flex; align-items: stretch; gap: 3px; }
.izi-ctx-shortcut-row > .izi-ctx-item { flex: 1; width: auto; min-width: 0; }
.izi-ctx-shortcut { flex: 0 0 30px; padding: 0; border: 1px solid var(--border); border-radius: 4px; background: var(--bg); color: var(--text); cursor: pointer; }
.izi-ctx-shortcut:disabled { opacity: .35; cursor: default; }
.izi-ctx-shortcut:not(:disabled):hover { background: var(--izi-primary-bg); }
.toolbar-left .filter-reset-btn {
    height: var(--izi-tb-h); min-height: var(--izi-tb-h);
    background: var(--izi-tb-bg); border-color: var(--izi-tb-border);
}
/* A stable search width keeps overflow measurements independent of the previous frame. */
.toolbar .search-box { flex-shrink: 0; }
@media (min-width: 769px) {
    .toolbar .search-box { width: clamp(220px, 28vw, 480px); }
}



/* Center creation until the full breadcrumb needs more room; then push it right. */
.collection-location-bar.has-create-action {
    position: relative;
    display: grid;
    grid-template-columns: minmax(max-content, 1fr) auto minmax(0, 1fr);
    column-gap: 12px; overflow-x: auto;
}
.has-create-action > .location-bar-icon { position: absolute; left: 12px; }
.has-create-action > .location-bar-path {
    grid-column: 1; grid-row: 1;
    margin-left: 24px; min-width: max-content; flex-wrap: nowrap;
    overflow: visible;
}
.has-create-action > .toolbar-create-actions {
    grid-column: 2; grid-row: 1; position: relative;
    margin: 0; padding: 0; border: 0;
}
.has-create-action .toolbar-create-btn {
    height: 32px; padding: 0 12px;
    background: var(--primary); color: var(--izi-on-primary, white);
    border: 1px solid var(--primary); font-weight: 600;
}
.has-create-action .toolbar-create-label { display: inline; }
.stats-bar { justify-content: center; }
.stats-count { margin-inline: auto; }


/* Selection actions stay next to the badges of each selected tile. */
.tile-selection-actions {
    flex: 0 0 16px; width: 16px; height: 20px;
    margin-left: 4px; padding: 0; align-self: flex-start;
    border: 0; border-radius: 0; box-shadow: none;
    background: transparent; color: inherit;
    font-size: 18px; line-height: 20px; cursor: pointer;
}
.tile-selection-actions:hover { background: transparent; }
.tile-selection-actions:focus-visible { outline: 1px solid currentColor; outline-offset: 2px; }
.prompt-card.selected .prompt-card-header > div:first-child { flex: 1; min-width: 0; }
.prompt-card.selected .prompt-badges { flex-shrink: 0; }
.prompts-table .tile-selection-actions { float: right; }
/* Keep the same narrow edge inset for actions, independent of tile padding. */
.prompt-card .tile-selection-actions {
    margin-right: calc(var(--izi-space-xs) - var(--izi-space-lg));
}
.prompts-grid.tiles-small .prompt-card .tile-selection-actions {
    margin-right: calc(var(--izi-space-xs) - var(--izi-space-md));
}
