body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: #111;
  color: #eee;
}

.ts-search-header {
  position: sticky;
  top: 0;
  z-index: 5;
  padding: 1rem 1.25rem;
  background: #1a1a1a;
  border-bottom: 1px solid #2a2a2a;
}

.ts-search-header h1 {
  margin: 0 0 0.75rem 0;
  font-size: 1.1rem;
  font-weight: 500;
}

.ts-search-header h1 a {
  color: #aaa;
  text-decoration: none;
}

.ts-search-header h1 a:hover { color: #fff; }

.ts-search-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1.25rem;
}

#ts-search-input {
  flex: 1 1 280px;
  min-width: 200px;
  padding: 0.6rem 0.8rem;
  font-size: 1rem;
  border-radius: 4px;
  border: 1px solid #333;
  background: #0e0e0e;
  color: #fff;
}

.ts-search-scopes {
  border: 0;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 0.9rem;
  font-size: 0.85rem;
  color: #bbb;
}

.ts-search-scopes legend {
  padding: 0 0.4rem 0 0;
  color: #777;
}

.ts-search-count {
  font-size: 0.85rem;
  color: #888;
  margin-left: auto;
}

.ts-search-results {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 0.75rem;
  padding: 0.75rem;
}

.ts-result {
  background: #1a1a1a;
  border-radius: 4px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
  transition: transform 0.1s;
}

.ts-result:hover { transform: translateY(-2px); }

.ts-result img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  display: block;
  background: #000;
}

.ts-result-meta {
  padding: 0.5rem 0.6rem;
  font-size: 0.78rem;
  line-height: 1.35;
}

.ts-result-filename {
  color: #ddd;
  word-break: break-all;
}

.ts-result-snippet {
  color: #888;
  margin-top: 0.25rem;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.ts-result-snippet mark {
  background: #ffcf3d;
  color: #111;
  padding: 0 2px;
  border-radius: 2px;
}

.ts-result-scope {
  display: inline-block;
  margin-right: 0.35rem;
  font-size: 0.7rem;
  padding: 1px 5px;
  border-radius: 2px;
  background: #333;
  color: #aaa;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.ts-empty {
  grid-column: 1 / -1;
  text-align: center;
  color: #666;
  padding: 3rem 1rem;
}
