/* Sidebar tools are permanent navigation; project search uses the same density. */
.wb-permanent-tool .workspace-tab-header-inner-close-button,
.wb-permanent-tool .workspace-tab-header-status-container { display: none !important; }
:is(.workspace-leaf-content, .wl-page)[data-type="file-explorer"] .wb-managed-asset { display: none !important; }
:is(.workspace-leaf-content, .wl-page)[data-type="world-builder-search"] > :is(.view-header, .wl-page-header) { display: none; }
:is(.workspace-leaf-content, .wl-page)[data-type="world-builder-search"] > :is(.view-content, .wl-page-content) { padding: 0; overflow: hidden; }
.wb-project-search { display: flex; flex-direction: column; height: 100%; min-height: 0; font-size: 12px; }
.wb-search-controls { flex: 0 0 auto; padding: 12px; border-bottom: 1px solid var(--wl-line); }
.wb-search-input-row { position: relative; display: flex; align-items: center; }
.wb-search-input-row input { flex: 1; min-width: 0; width: 100%; height: 32px; font-size: 12px; padding-inline: 28px 28px; }
.wb-search-input-row input::-webkit-search-cancel-button { display: none; }
.wb-search-lens { position: absolute; left: 9px; color: var(--wl-text-3); pointer-events: none; }
.wb-search-lens svg { display: block; width: 14px; height: 14px; }
.wb-search-clear { position: absolute; right: 4px; width: 24px; height: 24px; padding: 0; font-size: 16px; background: transparent; box-shadow: none; color: var(--wl-text-2); }
.wb-search-input-row input:placeholder-shown { padding-right: 8px; }
.wb-search-input-row input:placeholder-shown ~ .wb-search-clear { display: none; }
.wb-search-filters { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.wb-search-chip { display: inline-flex; align-items: center; gap: 3px; min-width: 0; max-width: 100%; height: 24px; padding: 0 6px 0 9px; border-radius: var(--r-md); font-size: 11px; font-weight: 450; color: var(--wl-text-3); background: var(--wl-inset); border: 1px solid var(--wl-line); box-shadow: none; }
.wb-search-chip > span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wb-search-chip:hover, .wb-search-chip.has-active-menu { color: var(--wl-text); background: var(--wl-raised); }
.wb-search-chip.is-set { color: var(--wl-text); border-color: color-mix(in srgb, var(--wl-selection) 45%, transparent); background: var(--wl-selection-soft); }
.wb-search-chip-arrow { flex: 0 0 auto; opacity: .7; }
.wb-search-chip-arrow svg { display: block; width: 12px; height: 12px; }
.wb-project-search button.wb-search-reset { height: 24px; padding: 0 6px; font-size: 11px; color: var(--wl-text-3); background: transparent; box-shadow: none; border: 0; }
.wb-project-search button.wb-search-reset:hover { color: var(--wl-text); background: transparent; text-decoration: underline; }
.wb-search-reset[hidden] { display: none; }
.wb-search-status { margin: 0; padding: 10px 12px 6px; color: var(--wl-text-3); font-size: 11px; }
.wb-search-status:empty { display: none; }
.wb-search-result mark { color: var(--wl-text); background: color-mix(in srgb, var(--wl-selection) 28%, transparent); border-radius: var(--r-xs); padding: 0 1px; }
.wb-search-results { min-height: 0; flex: 1; overflow: auto; padding: 0 6px 12px; }
.wb-search-result > button { display: flex; align-items: flex-start; gap: 8px; text-align: left; width: 100%; height: auto; min-height: 40px; padding: 8px 6px; background: transparent; box-shadow: none; border-radius: var(--r-sm); color: var(--wl-text); }
.wb-search-result > button:hover, .wb-search-result > button:focus-visible { background: var(--wl-raised); }
.wb-search-result > button:focus-visible, .wb-search-chip:focus-visible, .wb-project-search button.wb-search-reset:focus-visible { outline: 2px solid var(--wl-selection); outline-offset: 2px; }
.wb-search-icon { flex: 0 0 17px; color: var(--wl-text-2); padding-top: 1px; }
.wb-search-icon svg { display: block; width: 17px; height: 17px; }
.wb-search-result-text { display: flex; flex: 1; flex-direction: column; gap: 3px; min-width: 0; white-space: normal; }
.wb-search-result-text strong { font-size: 12px; font-weight: 550; overflow-wrap: anywhere; }
.wb-search-result-text small { font-size: 10px; color: var(--wl-text-3); overflow-wrap: anywhere; }
.wb-search-snippet { font-size: 11px; color: var(--wl-text-3); line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.wb-search-empty { margin: 12px 6px; color: var(--wl-text-3); line-height: 1.5; }
.wb-search-more { width: calc(100% - 12px); margin: 8px 6px; font-size: 11px; height: 28px; }
@media (pointer: coarse) { .wb-search-chip, .wb-search-reset { height: 32px; } .wb-search-input-row input { height: 38px; } }

/* A popout window has no project bar. Its window buttons sit at the end of the tab row, at
   the row's height, the tabs stop before them, and the empty part of the row moves the window. */
body.wb-shell.is-popout-window { --wb-bar-height: calc(var(--header-height) - 1px); --frame-right-space: 132px; }
body.wb-shell.is-popout-window:not(.is-fullscreen) .workspace-tabs.mod-top-right-space .workspace-tab-header-container { padding-right: calc(var(--size-4-2) + var(--frame-right-space)); }
body.wb-shell.is-popout-window:not(.is-grabbing):not(.is-fullscreen) .mod-top .workspace-tab-header-container { -webkit-app-region: drag; }

/* Settings lives at the foot of the rail, including with the file panel closed. */
.wb-shell .workspace-sidedock-vault-profile { display: none; }
.wb-shell .workspace-ribbon.mod-left .side-dock-settings { margin-top: 0; padding-bottom: 12px; }
.wb-shell .wb-settings-rail-button { flex-shrink: 0; }
.wb-shell .wb-settings-rail-button:focus-visible { outline: 2px solid var(--wl-selection); outline-offset: 2px; border-radius: var(--r-sm); }
