/* ===== Volltextsuche (Sidebar, src/search/index.js) ===== */
#search-results { padding: 4px 6px 24px; font-size: 12.5px; }
.search-loading, .search-err, .search-empty { padding: 12px 8px; color: var(--muted); }
.search-err { color: var(--err); }
.search-head {
  padding: 7px 8px; font-size: 11px; color: var(--muted);
  border-bottom: 1px solid var(--line); margin-bottom: 4px;
}
.search-section { margin-bottom: 6px; }
.search-section-label {
  padding: 6px 8px 3px; font-size: 10.5px; font-weight: 700;
  letter-spacing: .06em; text-transform: uppercase; color: var(--muted);
}

.search-row, .sf-header { border-radius: 7px; cursor: pointer; }
.search-row { padding: 5px 8px; }
.search-row:hover, .sf-header:hover { background: var(--panel2); }
.sr-head { display: flex; align-items: baseline; gap: 6px; min-width: 0; }
.sr-ico { flex-shrink: 0; font-size: 13px; }
.sr-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sr-dir {
  color: var(--muted); font-size: 10.5px; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap; flex-shrink: 1; margin-left: auto;
}
.sr-tags { display: flex; flex-wrap: wrap; gap: 4px; margin: 3px 0 0 21px; }
.search-tag-pill {
  background: var(--accent-dim); color: var(--text); border-radius: 8px;
  font-size: 10px; padding: 1px 7px;
}

.search-file { margin-bottom: 2px; }
.sf-header { padding: 5px 8px; }
.sf-line {
  display: flex; gap: 7px; padding: 2px 8px 2px 16px; cursor: pointer;
  border-radius: 6px; align-items: baseline;
}
.sf-line:hover { background: var(--panel2); }
.sf-ln { color: var(--muted); font-size: 10px; min-width: 22px; text-align: right; flex-shrink: 0; }
.sf-text {
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-size: 11.5px; color: var(--muted);
}
#search-results mark {
  background: var(--warn); color: #1b1b1f; border-radius: 3px; padding: 0 1px;
}

/* Gepinnte AND-Begriffe im Suchfeld */
.search-chip {
  display: inline-flex; align-items: center; gap: 2px; max-width: 110px;
  background: var(--accent-dim); border-radius: 8px; padding: 2px 3px 2px 8px;
  font-size: 11.5px; flex-shrink: 0; align-self: center;
}
.search-chip .sc-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.search-chip .sc-remove {
  background: none; border: 0; color: var(--muted); cursor: pointer;
  font-size: 13px; line-height: 1; padding: 0 4px; border-radius: 4px;
}
.search-chip .sc-remove:hover { color: var(--err); }
.sb-search { flex-wrap: wrap; }

/* ===== KI-Suche (src/search/ai.js) ===== */
.ai-box { display: flex; flex-direction: column; gap: 10px; min-height: 200px; }
.ai-off { padding: 30px 10px; text-align: center; color: var(--muted); line-height: 1.7; }
.ai-hint { font-size: 12.5px; color: var(--muted); line-height: 1.5; }
.ai-form { display: flex; gap: 8px; }
.ai-form .ai-input { flex: 1; }
.ai-status {
  display: flex; align-items: center; gap: 8px; font-size: 13px;
  padding: 8px 10px; background: var(--panel2); border-radius: 8px;
}
.ai-status-note { color: var(--muted); font-size: 11.5px; }
.ai-status .ai-cancel { color: var(--accent); margin-left: auto; }
.ai-spinner {
  width: 14px; height: 14px; border-radius: 50%; flex-shrink: 0;
  border: 2px solid var(--line); border-top-color: var(--accent);
  animation: ai-spin .8s linear infinite;
}
@keyframes ai-spin { to { transform: rotate(360deg); } }
.ai-err {
  color: var(--err); font-size: 12.5px; padding: 7px 10px;
  background: rgba(255,93,93,.08); border-radius: 8px;
}
.ai-res-head { display: flex; align-items: baseline; gap: 10px; margin-top: 2px; }
.ai-res-q { font-weight: 700; font-size: 13.5px; }
.ai-res-meta { color: var(--muted); font-size: 11.5px; margin-left: auto; }
.ai-summary {
  background: var(--panel2); border-left: 3px solid var(--accent);
  border-radius: 8px; padding: 9px 12px; font-size: 13px; line-height: 1.55;
}
.ai-empty { color: var(--muted); padding: 8px 2px; }
.ai-result {
  border: 1px solid var(--line); border-radius: 10px; padding: 9px 12px;
  cursor: pointer; margin-top: 6px;
}
.ai-result:hover { border-color: var(--accent); background: var(--panel2); }
.ai-result-head { display: flex; align-items: baseline; gap: 7px; min-width: 0; }
.ai-result-ico { flex-shrink: 0; }
.ai-result-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ai-result-dir {
  color: var(--muted); font-size: 11px; margin-left: auto;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.ai-result-reason { font-size: 12.5px; color: var(--muted); margin-top: 3px; }
.ai-result-snippet {
  font-size: 11.5px; font-family: ui-monospace, monospace; color: var(--muted);
  background: var(--bg); border-radius: 6px; padding: 5px 8px; margin-top: 6px;
  white-space: pre-wrap; word-break: break-word; max-height: 90px; overflow: hidden;
}
.ai-hist { border-top: 1px solid var(--line); padding-top: 8px; }
.ai-hist-label {
  font-size: 10.5px; font-weight: 700; letter-spacing: .06em;
  text-transform: uppercase; color: var(--muted); margin-bottom: 4px;
}
.ai-hist-row {
  display: flex; align-items: center; gap: 8px; padding: 5px 8px;
  border-radius: 7px; cursor: pointer; min-width: 0;
}
.ai-hist-row:hover { background: var(--panel2); }
.ai-hist-q { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12.5px; }
.ai-hist-meta { color: var(--muted); font-size: 11px; margin-left: auto; flex-shrink: 0; }
.ai-hist-del { font-size: 13px; padding: 1px 5px; flex-shrink: 0; }
.ai-hist-del:hover { color: var(--err); }

/* ===== Backlinks-Panel (src/ui/backlinks-panel.js) ===== */
#backlinks-panel { max-height: 38%; display: flex; flex-direction: column; }
#backlinks-panel .bl-count { font-size: 10px; color: var(--muted); text-transform: none; }
#backlinks-body { overflow-y: auto; padding: 0 6px 8px; }
.bl-sec + .bl-sec { margin-top: 6px; }
.bl-label { font-size: 10.5px; color: var(--muted); padding: 2px 6px; }
.bl-empty { font-size: 11.5px; color: var(--muted); padding: 1px 10px 3px; font-style: italic; }
.bl-row {
  display: flex; align-items: baseline; gap: 6px; width: 100%; min-width: 0;
  background: none; border: 0; text-align: left; cursor: pointer;
  padding: 4px 8px; border-radius: 7px; font-size: 12.5px; color: var(--text);
}
.bl-row:hover { background: var(--panel2); }
.bl-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bl-dir {
  color: var(--muted); font-size: 10.5px; margin-left: auto;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
