/* Header tool search (button + panel matching header/container width) */
.header-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
  position: relative;
}

.header-search-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: #ffffff;
  cursor: pointer;
  transition: color 0.2s ease, background-color 0.2s ease;
}

.header-search-btn:hover,
.header-search-btn[aria-expanded="true"] {
  color: #4a90e2;
  background-color: rgba(255, 255, 255, 0.08);
}

.tool-search-overlay {
  position: fixed;
  inset: 0;
  z-index: 3000;
  pointer-events: none;
}

.tool-search-overlay[hidden] {
  display: none !important;
}

.tool-search-backdrop {
  position: absolute;
  inset: 0;
  background: transparent;
  pointer-events: auto;
}

.tool-search-sheet {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 1;
  box-sizing: border-box;
  width: 100%;
  max-width: 1200px;
  display: flex;
  flex-direction: column;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-top: none;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.16);
  pointer-events: auto;
}

.tool-search-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-bottom: 1px solid #eef2f7;
  background: #f8fafc;
}

.tool-search-bar-icon {
  flex-shrink: 0;
  color: #64748b;
}

.tool-search-input {
  flex: 1;
  min-width: 0;
  border: none;
  background: transparent;
  outline: none;
  font-size: 16px;
  line-height: 1.4;
  padding: 6px 0;
  color: #0f172a;
}

.tool-search-input::-webkit-search-decoration,
.tool-search-input::-webkit-search-cancel-button {
  -webkit-appearance: none;
  appearance: none;
}

.tool-search-close {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: #64748b;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}

.tool-search-close:hover {
  background: #eef2f7;
  color: #0f172a;
}

.tool-search-results {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 20px;
  padding: 12px 16px 24px;
  max-height: min(40vh, 360px);
  overflow-y: auto;
}

.tool-search-result {
  display: inline;
  padding: 0;
  border-radius: 0;
  color: #2563eb;
  text-decoration: underline;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.5;
  background: transparent;
}

.tool-search-result:hover,
.tool-search-result.is-active {
  color: #1d4ed8;
  background: transparent;
  text-decoration: underline;
}

.tool-search-empty,
.tool-search-hint {
  margin: 0;
  padding: 14px 16px 24px;
  font-size: 13px;
  color: #64748b;
  text-align: center;
}

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
