.search-bar {
  position: relative;
  padding: 14px;
  display: grid;
  gap: 12px;
}

.search-shell {
  display: grid;
  gap: 12px;
}

.search-form {
  display: grid;
  grid-template-columns: 1fr auto auto auto;
  gap: 8px;
}

.search-form input {
  min-height: 44px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 0 12px;
  font: inherit;
}

.search-form input:focus-visible {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary-color) 18%, transparent);
  outline: 0;
}

.loading-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid var(--border-color);
  border-top-color: var(--primary-color);
  animation: search-spin 0.8s linear infinite;
  align-self: center;
  justify-self: center;
}

@keyframes search-spin {
  to { transform: rotate(360deg); }
}

.search-form button {
  min-height: 44px;
  border: 0;
  border-radius: var(--radius-sm);
  background: var(--primary-color);
  color: #fff;
  font-weight: var(--font-weight-bold, 700);
  padding: 0 14px;
  cursor: pointer;
}

.search-clear-btn {
  min-width: 44px;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border-color) !important;
  border-radius: var(--radius-sm);
  background: var(--bg-primary) !important;
  color: var(--text-secondary) !important;
  line-height: 1;
}

.suggestions {
  display: grid;
  gap: 8px;
}

.suggestion-list {
  display: grid;
  gap: 6px;
}

.suggestion-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  background: var(--bg-primary);
  color: var(--text-primary);
  padding: 8px 10px;
  text-align: left;
  cursor: pointer;
}

.suggestion-item.active {
  border-color: var(--primary-color);
  background: color-mix(in srgb, var(--primary-color) 7%, white);
}

.suggestion-icon {
  display: flex;
  align-items: center;
  color: var(--text-secondary);
}

.suggestion-copy {
  display: grid;
}

.suggestion-title {
  font-weight: var(--font-weight-bold, 700);
}

.suggestion-copy small,
.suggestion-type {
  color: var(--text-secondary);
  font-size: var(--font-size-xs, 0.75rem);
}

.chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  min-height: 32px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-full, 999px);
  background: var(--bg-primary);
  color: var(--text-secondary);
  padding: 0 10px;
  cursor: pointer;
}

.history-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.history-head button {
  border: 0;
  background: transparent;
  color: var(--primary-color);
  cursor: pointer;
  font-weight: var(--font-weight-bold, 700);
}

.no-results {
  margin: 0;
  color: var(--text-secondary);
}

.mobile-overlay-backdrop {
  display: none;
}

@media (max-width: 767px) {
  .search-form {
    grid-template-columns: 1fr auto auto;
  }

  .search-form button[type='submit'] {
    grid-column: 1 / -1;
    width: 100%;
  }

  .mobile-overlay-open .mobile-overlay-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(16, 24, 24, 0.5);
    z-index: 30;
  }

  .search-shell.mobile-overlay {
    position: fixed;
    inset: auto 0 0 0;
    max-height: 82vh;
    overflow: auto;
    border-radius: 14px 14px 0 0;
    background: #fff;
    padding: 12px;
    z-index: 31;
    box-shadow: 0 -8px 28px rgba(0, 0, 0, 0.18);
  }

  .chip,
  .suggestion-item,
  .history-head button {
    min-height: 44px;
  }
}
