#knowledge-search.view.active { overflow: hidden; }
.knowledge-search-workspace { display: grid; grid-template-rows: auto auto minmax(0, 1fr) auto; gap: 10px; height: calc(100vh - 132px); min-height: 0; }
.knowledge-search-hero { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 13px 19px; border: 1px solid #d5ebe0; border-radius: 15px; background: linear-gradient(120deg, #fbfffd, #eefaf4 72%, #e4f5ec); box-shadow: 0 8px 20px rgba(46,91,73,.06); }
.knowledge-search-hero h2 { margin: 2px 0 3px; color: #173f31; font-size: 20px; letter-spacing: -.03em; }
.knowledge-search-hero-title { display: inline-flex !important; flex: 1 1 auto; flex-direction: row !important; flex-wrap: nowrap !important; align-items: baseline; gap: 10px; min-width: 0; max-width: 100%; overflow: hidden; white-space: nowrap !important; }
.knowledge-search-hero-title > * { display: inline-block; flex: 0 0 auto; white-space: nowrap; }
.knowledge-search-hero p { margin: 0; color: #698179; font-size: 12px; }
.knowledge-search-eyebrow { color: #4a9b7d; font-size: 10px; font-weight: 800; letter-spacing: .13em; }
.knowledge-search-hero-stats { display: grid; min-width: 100px; padding: 10px 15px; border: 1px solid #cfe7da; border-radius: 14px; background: rgba(255,255,255,.72); text-align: center; }
.knowledge-search-hero-stats strong { color: #237658; font-size: 25px; line-height: 1; }
.knowledge-search-hero-stats span { color: #5e7a6e; font-size: 10px; }
.knowledge-search-hero-stats small { margin-top: 4px; color: var(--muted); font-size: 10px; }
.knowledge-search-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.knowledge-search-query { display: flex; align-items: center; gap: 8px; flex: 1; max-width: 780px; padding: 4px 5px 4px 12px; border: 1px solid #cfe2d9; border-radius: 13px; background: #fff; box-shadow: 0 8px 20px rgba(46,91,73,.05); }
.knowledge-search-query > svg { flex: 0 0 auto; width: 17px; color: var(--mint-dark); }
.knowledge-search-query input { min-width: 0; padding: 8px 3px; border: 0; box-shadow: none; }
.knowledge-search-query input:focus { box-shadow: none; }
.knowledge-search-query button { padding: 8px 15px; }
.knowledge-search-toolbar-meta { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 11px; }
.knowledge-search-toolbar-meta kbd { padding: 2px 5px; border: 1px solid var(--line); border-radius: 5px; background: #fff; font: 10px ui-monospace, monospace; }
.knowledge-search-toolbar-meta button { padding: 6px 9px; font-size: 11px; }
.knowledge-search-grid { display: grid; grid-template-columns: 204px minmax(390px, 1.25fr) minmax(330px, .84fr); gap: 10px; min-height: 0; height: 100%; }
.knowledge-search-panel { display: flex; min-width: 0; min-height: 0; flex-direction: column; overflow: hidden; padding: 0; }
.knowledge-search-panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; padding: 15px 16px 12px; border-bottom: 1px solid var(--line); }
.knowledge-search-panel-head h3 { margin: 3px 0 0; color: #214b3c; font-size: 14px; }
.knowledge-search-result-summary { max-width: 180px; overflow: hidden; color: var(--muted); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.knowledge-search-library-list { flex: 1; min-height: 0; overflow: auto; padding: 9px; }
.knowledge-search-library { display: grid; grid-template-columns: 28px minmax(0, 1fr) 14px; align-items: center; gap: 8px; width: 100%; margin-bottom: 5px; padding: 10px; border: 1px solid transparent; border-radius: 12px; background: transparent; color: var(--text); text-align: left; box-shadow: none; }
.knowledge-search-library:hover, .knowledge-search-library.active { border-color: #cfe9dc; background: #eff9f4; color: var(--mint-dark); }
.knowledge-search-library-icon { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 9px; background: #e4f5ec; color: #328c6e; }
.knowledge-search-library-icon svg { width: 15px; }
.knowledge-search-library strong, .knowledge-search-library small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.knowledge-search-library strong { font-size: 12px; }
.knowledge-search-library small { margin-top: 2px; color: var(--muted); font-size: 10px; }
.knowledge-search-library-arrow { width: 13px; color: #9ab4a7; }
.knowledge-search-scope-note { display: flex; gap: 7px; align-items: flex-start; padding: 12px 13px; border-top: 1px solid var(--line); color: #6b8177; font-size: 10px; line-height: 1.55; }
.knowledge-search-scope-note svg { flex: 0 0 auto; width: 14px; color: #4ba17f; }
.knowledge-search-results-scroll { flex: 1; min-height: 0; overflow: auto; padding: 8px; }
.knowledge-search-result { margin-bottom: 8px; border: 1px solid #e4eee9; border-radius: 12px; background: #fff; overflow: hidden; }
.knowledge-search-result.active { border-color: #bcdcca; box-shadow: 0 5px 13px rgba(46,91,73,.06); }
.knowledge-search-result-head { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 8px; width: 100%; padding: 11px 12px 9px; border: 0; border-bottom: 1px solid #edf3ef; border-radius: 0; background: #fbfefc; color: var(--text); text-align: left; box-shadow: none; }
.knowledge-search-result-head:hover { background: #f4fbf7; color: var(--text); }
.knowledge-search-result-head-actions { display: flex; align-items: center; gap: 7px; }
.knowledge-search-select-file { padding: 3px 6px; border: 1px solid #d7e9df; border-radius: 6px; background: #fff; color: #41836b; font-size: 9px; font-weight: 700; box-shadow: none; }
.knowledge-search-select-file:hover { background: #e9f8ef; color: #216d52; }
.knowledge-search-result-file { display: flex; align-items: center; gap: 7px; min-width: 0; }
.knowledge-search-result-file svg { flex: 0 0 auto; width: 15px; color: #459a79; }
.knowledge-search-result-file strong { overflow: hidden; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.knowledge-search-result-count { color: #2f896a; font-size: 10px; font-weight: 800; }
.knowledge-search-result-head small { grid-column: 1 / -1; overflow: hidden; color: var(--muted); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.knowledge-search-hit-list { padding: 2px 8px 6px; }
.knowledge-search-hit { display: grid; grid-template-columns: 16px minmax(0, 1fr); gap: 7px; align-items: start; padding: 8px 4px; border-radius: 8px; cursor: pointer; }
.knowledge-search-hit:hover, .knowledge-search-hit.selected { background: #f1faf5; }
.knowledge-search-hit input { width: 14px; height: 14px; margin-top: 3px; accent-color: var(--mint); }
.knowledge-search-hit-copy { min-width: 0; }
.knowledge-search-hit-meta { display: block; margin-bottom: 3px; color: #719084; font-size: 10px; }
.knowledge-search-hit-context { display: block; color: #50685d; font-size: 11px; line-height: 1.55; }
.knowledge-search-hit-context mark, .knowledge-search-preview-context mark { padding: 1px 3px; border-radius: 4px; background: #c9f0dc; color: #176947; font-weight: 800; }
.knowledge-search-state, .knowledge-search-preview-empty { display: grid; place-items: center; align-content: center; gap: 8px; min-height: 270px; padding: 28px; color: var(--muted); text-align: center; }
.knowledge-search-state svg, .knowledge-search-preview-empty svg { width: 27px; height: 27px; color: #58a888; }
.knowledge-search-state strong, .knowledge-search-preview-empty strong { color: #3b5f50; font-size: 13px; }
.knowledge-search-state small, .knowledge-search-preview-empty small { max-width: 230px; font-size: 11px; line-height: 1.55; }
.knowledge-search-state.is-error svg { color: var(--danger); }
.knowledge-search-state button { margin-top: 5px; padding: 7px 11px; font-size: 11px; }
.knowledge-search-spinner { width: 24px; height: 24px; border: 3px solid #d8eee3; border-top-color: var(--mint); border-radius: 50%; animation: knowledge-search-spin .8s linear infinite; }
@keyframes knowledge-search-spin { to { transform: rotate(360deg); } }
.knowledge-search-preview { padding: 0; }
.knowledge-search-preview-shell { display: flex; min-width: 0; min-height: 0; height: 100%; flex-direction: column; overflow: hidden; }
.knowledge-search-preview-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.knowledge-search-preview-head h3 { margin: 4px 0 4px; color: #214b3c; font-size: 16px; }
.knowledge-search-preview-head p { margin: 0; overflow: hidden; color: var(--muted); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.knowledge-search-preview-body { min-height: 0; overflow: auto; padding: 14px 17px 18px; }
.knowledge-search-preview-path { display: flex; align-items: center; gap: 6px; color: #468a70; font-size: 11px; font-weight: 700; }
.knowledge-search-preview-path svg { width: 14px; }
.knowledge-search-preview-context { margin-top: 12px; padding: 14px; border: 1px solid #e2eee7; border-radius: 12px; background: #f8fcfa; color: #50685d; font-size: 12px; line-height: 1.8; }
.knowledge-search-preview-meta { display: grid; gap: 8px; margin: 14px 0 0; }
.knowledge-search-preview-meta div { display: flex; justify-content: space-between; gap: 10px; padding-bottom: 8px; border-bottom: 1px dashed #e1ece6; }
.knowledge-search-preview-meta dt { color: var(--muted); font-size: 10px; }
.knowledge-search-preview-meta dd { margin: 0; color: #46695a; font-size: 10px; text-align: right; }
.knowledge-search-selection-bar { position: sticky; bottom: 0; z-index: 4; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 13px; border: 1px solid #cfe5d9; border-radius: 12px; background: rgba(240,250,244,.97); box-shadow: 0 8px 20px rgba(46,91,73,.08); }
.knowledge-search-operation-status { display: flex; align-items: center; gap: 5px; margin-bottom: 3px; color: #287b5e; font-size: 10px; }
.knowledge-search-operation-status svg { width: 12px; animation: knowledge-search-spin .9s linear infinite; }
.knowledge-search-operation-status small { color: var(--muted); }
.knowledge-search-selection-bar strong, .knowledge-search-selection-bar small { display: block; }
.knowledge-search-selection-bar strong { color: #236e53; font-size: 12px; }
.knowledge-search-selection-bar small { margin-top: 2px; color: #668277; font-size: 10px; }
.knowledge-search-selection-bar button { padding: 7px 10px; font-size: 11px; }
.knowledge-search-empty-copy { padding: 30px 12px; color: var(--muted); font-size: 11px; text-align: center; }
.knowledge-search-mode-tabs { display: flex; gap: 4px; padding: 8px 12px 0; border-bottom: 1px solid var(--line); }
.knowledge-search-mode-tabs button { padding: 6px 9px; border: 0; border-bottom: 2px solid transparent; border-radius: 6px 6px 0 0; background: transparent; color: var(--muted); font-size: 11px; box-shadow: none; }
.knowledge-search-mode-tabs button:hover, .knowledge-search-mode-tabs button.active { border-bottom-color: var(--mint); background: #f2faf5; color: #237658; }
.knowledge-search-mode-tabs button:disabled { cursor: not-allowed; opacity: .45; }
.knowledge-search-source-note, .knowledge-search-editor-impact, .knowledge-search-replace-warning { display: flex; align-items: flex-start; gap: 7px; border: 1px solid #dceee4; border-radius: 9px; background: #f5fbf7; color: #58776a; font-size: 10px; line-height: 1.55; }
.knowledge-search-source-note { margin: 16px 0 0; padding: 9px 10px; }
.knowledge-search-source-note svg, .knowledge-search-editor-impact svg, .knowledge-search-replace-warning svg { flex: 0 0 auto; width: 14px; color: #36916e; }
.knowledge-search-editor-shell .knowledge-search-preview-head, .knowledge-search-replace-shell .knowledge-search-preview-head { flex: 0 0 auto; }
.knowledge-search-inline-close { padding: 5px 8px; font-size: 10px; }
.knowledge-search-editor-impact { margin: 10px 13px; padding: 9px 10px; }
.knowledge-search-editor-impact strong, .knowledge-search-editor-impact span { display: block; }
.knowledge-search-editor-impact strong { color: #2e6e56; }
.knowledge-search-editor-impact span { margin-top: 2px; }
.knowledge-search-editor-shell > textarea { flex: 1; min-height: 0; width: auto; resize: none; margin: 0 13px; padding: 12px; border: 1px solid #dcebe3; border-radius: 9px; background: #fbfefc; color: #29483b; font: 12px/1.65 ui-monospace, SFMono-Regular, Menlo, monospace; outline: none; }
.knowledge-search-editor-shell > textarea:focus { border-color: #70b99a; box-shadow: 0 0 0 3px rgba(72,171,139,.12); }
.knowledge-search-editor-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex: 0 0 auto; padding: 10px 13px; border-top: 1px solid var(--line); color: var(--muted); font-size: 10px; }
.knowledge-search-editor-foot > div { display: flex; gap: 7px; }
.knowledge-search-editor-foot button { padding: 7px 9px; font-size: 10px; }
.knowledge-search-replace-form button[aria-disabled="true"] { cursor: not-allowed; opacity: .5; }
.knowledge-search-replace-form { display: flex; min-height: 0; flex: 1; flex-direction: column; overflow: hidden; }
.knowledge-search-replace-form > label { padding: 8px 13px 0; color: #547466; font-size: 10px; }
.knowledge-search-replace-form input { margin-top: 4px; padding: 7px 8px; font-size: 11px; }
.knowledge-search-replace-form input[readonly] { background: #f5faf7; color: #547466; }
.knowledge-search-replace-warning { flex: 0 0 auto; margin: 10px 13px; padding: 8px 9px; border-color: #f0deb9; background: #fffbf1; color: #88662c; }
.knowledge-search-replace-preview-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 13px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); color: #355e4d; font-size: 11px; }
.knowledge-search-replace-preview-head small { color: var(--muted); font-size: 10px; }
.knowledge-search-replace-preview { min-height: 0; flex: 1; overflow: auto; padding: 9px 13px; background: #fbfefc; }
.knowledge-search-replace-preview .knowledge-batch-file { margin-bottom: 8px; }
.knowledge-search-replace-preview .knowledge-batch-diff { padding: 7px 9px; }
.knowledge-search-replace-preview .knowledge-batch-diff div { font-size: 10px; }
.knowledge-batch-dialog { display: flex; width: min(720px, 96vw); max-height: min(780px, 92vh); flex-direction: column; overflow: hidden; border: 1px solid #d6e9df; border-radius: 18px; background: #fff; box-shadow: 0 24px 70px rgba(24, 60, 44, .22); }
.knowledge-batch-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; padding: 21px 23px 16px; border-bottom: 1px solid var(--line); background: linear-gradient(135deg, #fbfffd, #eff9f4); }
.knowledge-batch-head h2 { margin: 4px 0 4px; color: #193f31; font-size: 19px; }
.knowledge-batch-head p { margin: 0; color: var(--muted); font-size: 11px; }
.knowledge-batch-close { width: 30px; height: 30px; padding: 0; }
.knowledge-batch-close svg { width: 15px; }
.knowledge-batch-form { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; padding: 17px 23px 13px; }
.knowledge-batch-form label { color: #506b5e; }
.knowledge-batch-form input[readonly] { background: #f5faf7; color: #557568; }
.knowledge-batch-warning { grid-column: 1 / -1; display: flex; align-items: flex-start; gap: 7px; margin: 0; padding: 9px 11px; border: 1px solid #f0deb9; border-radius: 10px; background: #fffbf1; color: #88662c; font-size: 11px; line-height: 1.5; }
.knowledge-batch-warning svg { flex: 0 0 auto; width: 14px; }
.knowledge-batch-preview-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 23px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); color: #355e4d; }
.knowledge-batch-preview-head small { color: var(--muted); font-size: 10px; }
.knowledge-batch-preview { min-height: 120px; flex: 1; overflow: auto; padding: 12px 23px; background: #fbfefc; }
.knowledge-batch-empty { display: grid; min-height: 120px; place-items: center; color: var(--muted); font-size: 11px; }
.knowledge-batch-file { margin-bottom: 10px; border: 1px solid #dfede5; border-radius: 11px; background: #fff; overflow: hidden; }
.knowledge-batch-file-head { display: flex; justify-content: space-between; gap: 8px; padding: 9px 11px; border-bottom: 1px solid #edf3ef; color: #315f4c; font-size: 11px; }
.knowledge-batch-file-head span { color: #4b9776; font-size: 10px; }
.knowledge-batch-diff { padding: 8px 11px; border-bottom: 1px dashed #e5eee9; }
.knowledge-batch-diff:last-child { border-bottom: 0; }
.knowledge-batch-diff small { display: block; margin-bottom: 4px; color: var(--muted); font-size: 10px; }
.knowledge-batch-diff div { display: grid; gap: 4px; font-size: 11px; line-height: 1.55; }
.knowledge-batch-diff del, .knowledge-batch-diff ins { display: block; overflow-wrap: anywhere; padding: 5px 7px; text-decoration: none; }
.knowledge-batch-diff del { background: #fff0ef; color: #a4574e; }
.knowledge-batch-diff ins { background: #eaf8ef; color: #277253; }
.knowledge-batch-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 13px 23px; border-top: 1px solid var(--line); }
.knowledge-batch-foot button { padding: 8px 12px; font-size: 11px; }
@media (max-width: 620px) { .knowledge-batch-form { grid-template-columns: 1fr; } .knowledge-batch-warning { grid-column: auto; } .knowledge-batch-head, .knowledge-batch-form, .knowledge-batch-preview-head, .knowledge-batch-preview, .knowledge-batch-foot { padding-left: 15px; padding-right: 15px; } }
@media (max-width: 1120px) { .knowledge-search-workspace { height: auto; min-height: calc(100vh - 132px); } .knowledge-search-grid { grid-template-columns: 200px minmax(0, 1fr); height: 560px; } .knowledge-search-preview { min-height: 300px; grid-column: 1 / -1; } }
@media (max-width: 760px) { #knowledge-search.view.active { overflow: auto; } .knowledge-search-workspace { height: auto; } .knowledge-search-hero, .knowledge-search-toolbar, .knowledge-search-selection-bar { align-items: stretch; flex-direction: column; } .knowledge-search-toolbar-meta { justify-content: space-between; } .knowledge-search-grid { grid-template-columns: 1fr; height: auto; } .knowledge-search-scopes { min-height: 170px; } .knowledge-search-library-list { display: flex; gap: 6px; overflow-x: auto; } .knowledge-search-library { min-width: 185px; margin: 0; } .knowledge-search-results { min-height: 520px; } .knowledge-search-preview { grid-column: auto; min-height: 460px; } }
