.search-shell {
  padding-bottom: 48px;
}

.search-input-large {
  min-height: 48px;
}

.calc-toolbar-search { position: relative; }

.search-autocomplete {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  z-index: 20;
  border: 1px solid #dbe3ee;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 16px 36px rgba(15, 23, 42, .12);
  overflow: hidden;
}

.search-suggestion {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  min-height: 42px;
  border: 0;
  border-bottom: 1px solid #eef2f7;
  background: #fff;
  color: #0f172a;
  padding: 8px 12px;
  text-align: left;
  font: inherit;
  cursor: pointer;
}

.search-suggestion:last-child { border-bottom: 0; }
.search-suggestion:hover,
.search-suggestion.is-active { background: #eff6ff; }
.search-suggestion strong { font-size: 13px; }
.search-suggestion span {
  flex: 0 0 auto;
  color: #64748b;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.search-type-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 14px 0 8px;
}

.search-type {
  border: 1px solid #d1d5db;
  background: #ffffff;
  color: var(--c-text-secondary, #6b7280);
  border-radius: 999px;
  padding: 7px 12px;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.search-type.is-active {
  border-color: var(--c-primary, #2563eb);
  background: #eff6ff;
  color: var(--c-primary, #2563eb);
}

.smart-finder {
  margin: 18px 0 16px;
  padding: 16px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #ffffff;
}

.smart-finder-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: baseline;
  margin-bottom: 12px;
}

.smart-finder h2,
.saved-tools h2 {
  margin: 0;
  font-size: 15px;
  line-height: 1.3;
}

.smart-finder p {
  margin: 0;
  color: var(--c-text-secondary, #6b7280);
  font-size: 13px;
}

.smart-finder-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.smart-finder-card {
  text-align: left;
  border: 1px solid #dbe3ee;
  background: #f8fafc;
  border-radius: 8px;
  padding: 11px 12px;
  font: inherit;
  cursor: pointer;
}

.smart-finder-card:hover,
.smart-finder-card:focus-visible {
  border-color: #93c5fd;
  background: #eff6ff;
  outline: none;
}

.smart-finder-card strong {
  display: block;
  font-size: 13px;
  color: #0f172a;
}

.smart-finder-card span {
  display: block;
  margin-top: 3px;
  color: #64748b;
  font-size: 12px;
  line-height: 1.35;
}

.saved-tools {
  display: grid;
  gap: 14px;
  margin: 16px 0;
}

.saved-tools-section {
  display: grid;
  gap: 8px;
}

.saved-tools-row {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.saved-tool-chip {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 34px;
  max-width: 240px;
  padding: 0 10px;
  border: 1px solid #dbe3ee;
  border-radius: 8px;
  background: #ffffff;
  color: #0f172a;
  text-decoration: none;
  font-size: 13px;
  font-weight: 700;
}

.saved-tool-chip:hover {
  border-color: #93c5fd;
  color: var(--c-primary, #2563eb);
  text-decoration: none;
}

.search-result-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 10px;
}

.search-save-btn {
  border: 1px solid #d1d5db;
  background: #fff;
  color: #475569;
  border-radius: 8px;
  min-height: 30px;
  padding: 0 9px;
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.search-save-btn:hover { border-color: #93c5fd; color: var(--c-primary, #2563eb); }

.search-results {
  display: grid;
  gap: 10px;
  margin-top: 10px;
}

.search-best-card {
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  background: #eff6ff;
  padding: 14px 16px;
}

.search-best-label {
  display: inline-flex;
  margin-bottom: 8px;
  color: #1d4ed8;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .05em;
  text-transform: uppercase;
}

.search-related {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}

.search-related a {
  color: #1d4ed8;
  background: #fff;
  border: 1px solid #bfdbfe;
  border-radius: 999px;
  padding: 4px 8px;
  font-size: 12px;
  font-weight: 800;
  text-decoration: none;
}

.search-related a:hover { background: #dbeafe; text-decoration: none; }

.search-result {
  display: block;
  color: inherit;
  text-decoration: none;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #ffffff;
  padding: 14px 16px;
}

.search-result:hover {
  border-color: #bfdbfe;
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.08);
}

.search-result-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.search-result-title {
  margin: 0;
  font-size: 16px;
  line-height: 1.3;
}

.search-result-kind {
  flex: 0 0 auto;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: #475569;
  background: #f1f5f9;
  border-radius: 999px;
  padding: 4px 8px;
}

.search-result-desc {
  margin: 6px 0 0;
  color: var(--c-text-secondary, #6b7280);
  font-size: 14px;
  line-height: 1.5;
}

.search-result-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.search-result-tag {
  font-size: 12px;
  font-weight: 700;
  color: #475569;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 999px;
  padding: 3px 7px;
}

.search-empty {
  border: 1px dashed #cbd5e1;
  border-radius: 8px;
  color: #64748b;
  padding: 18px;
  background: #f8fafc;
}

@media (max-width: 640px) {
  .smart-finder-head {
    display: block;
  }
  .smart-finder-head p {
    margin-top: 4px;
  }
  .smart-finder-grid {
    grid-template-columns: 1fr;
  }
  .search-result-head {
    align-items: flex-start;
    flex-direction: column;
  }
}
