.overlay {
  position: fixed;
  inset: 0;
  background: rgba(26, 22, 18, 0.55);
  z-index: 1000;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 12vh;
  backdrop-filter: blur(2px);
}

.panel {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 640px;
  max-width: 96vw;
  display: flex;
  flex-direction: column;
  max-height: 70vh;
  overflow: hidden;
}

/* Search area */
.searchArea {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-subtle);
  flex-shrink: 0;
}

.searchIcon {
  font-size: 16px;
  color: var(--text-muted);
  flex-shrink: 0;
}

.input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--text-primary);
  min-width: 0;
}

.input::placeholder {
  color: var(--text-faint);
}

/* Scope filter tags */
.scopeTag {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  background: var(--amber-bg);
  border: 1px solid var(--amber-light);
  border-radius: 4px;
  padding: 1px 6px;
  font-size: 12px;
  flex-shrink: 0;
}

.scopeField {
  color: var(--amber-deep);
  font-weight: 600;
  font-family: var(--font-mono);
}

.scopeValue {
  color: var(--amber);
  font-family: var(--font-mono);
}

.scopeRemove {
  background: none;
  border: none;
  color: var(--amber);
  cursor: pointer;
  font-size: 13px;
  line-height: 1;
  padding: 0;
  opacity: 0.6;
}

.scopeRemove:hover {
  opacity: 1;
}

/* Category tabs */
.tabs {
  display: flex;
  gap: 0;
  padding: 0 16px;
  border-bottom: 1px solid var(--border-subtle);
  flex-shrink: 0;
  overflow-x: auto;
}

.tab {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  white-space: nowrap;
  transition: color 0.12s, border-color 0.12s;
  margin-bottom: -1px;
}

.tab:hover {
  color: var(--text-secondary);
}

.tabActive {
  color: var(--amber);
  border-bottom-color: var(--amber);
}

.tabCount {
  background: var(--bg-inset);
  border-radius: 10px;
  padding: 0 6px;
  font-size: 12px;
  font-family: var(--font-mono);
  color: var(--text-muted);
}

.tabActive .tabCount {
  background: var(--amber-bg);
  color: var(--amber-deep);
}

/* Results */
.results {
  flex: 1;
  overflow-y: auto;
  min-height: 0;
}

.empty {
  padding: 32px;
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
}

.group {
  /* group container */
}

.groupHeader {
  padding: 8px 16px 4px;
  position: sticky;
  top: 0;
  background: var(--bg-surface);
  z-index: 1;
}

/* Result item */
.item {
  padding: 8px 16px;
  cursor: pointer;
  border-bottom: 1px solid var(--border-subtle);
  transition: background 0.08s;
}

.item:last-child {
  border-bottom: none;
}

.item:hover,
.focused {
  background: var(--bg-hover);
}

.itemMain {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.itemIcon {
  flex-shrink: 0;
  font-size: 14px;
  margin-top: 1px;
  color: var(--text-muted);
}

.itemContent {
  flex: 1;
  min-width: 0;
}

.itemTop {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.itemTitle {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
}

.itemBadges {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}

.badge {
  display: inline-flex;
  padding: 1px 7px;
  border-radius: 10px;
  font-size: 12px;
  font-family: var(--font-mono);
  font-weight: 600;
  background: var(--bg-inset);
  color: var(--text-muted);
  border: 1px solid var(--border);
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.itemTime {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-faint);
  margin-left: auto;
}

.itemMeta {
  font-size: 12px;
  color: var(--text-muted);
  font-family: var(--font-mono);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.expandBtn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 12px;
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  flex-shrink: 0;
  transition: color 0.1s, background 0.1s;
}

.expandBtn:hover {
  background: var(--bg-inset);
  color: var(--text-secondary);
}

.expanded {
  margin-top: 8px;
  max-height: 200px;
  overflow-y: auto;
}

/* Match context snippet */
.matchContext {
  font-size: 12px;
  color: var(--text-faint);
  font-family: var(--font-mono);
  margin-top: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.matchContext em {
  font-style: normal;
  color: var(--amber);
  font-weight: 600;
}

/* Match highlight */
.mark {
  background: none;
  color: var(--amber);
  font-weight: 600;
}

/* Shortcuts bar */
.shortcutsBar {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 8px 16px;
  border-top: 1px solid var(--border-subtle);
  flex-shrink: 0;
  background: var(--bg-raised);
}

.shortcut {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  color: var(--text-muted);
}
