.ts-search {
  --ts-accent: #565BD7;
  --ts-bg: #FFFFFF;
  --ts-max: 680px;
  position: relative;
  max-width: var(--ts-max);
  margin: 0 auto;
  width: 100%;
}
.ts-search__field {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--ts-bg);
  border-radius: 999px;
  padding: 6px 8px 6px 22px;
  box-shadow: 0 12px 32px -8px rgba(86,91,215,0.28), 0 2px 6px rgba(0,0,0,0.05);
  transition: box-shadow 0.2s ease;
}
.ts-search--open .ts-search__field,
.ts-search__field:focus-within {
  box-shadow: 0 16px 40px -8px rgba(86,91,215,0.4),
              0 0 0 3px rgba(86,91,215,0.18);
}
.ts-search__icon {
  width: 22px; height: 22px;
  color: var(--ts-accent);
  flex-shrink: 0;
}
.ts-search__icon svg { width: 100%; height: 100%; }
.ts-search__input {
  flex: 1;
  border: none;
  background: transparent;
  outline: none;
  font-size: 1.0625rem;
  padding: 16px 4px;
  font-weight: 500;
  color: #1A1F2E;
  min-width: 0;
}
.ts-search__input::placeholder {
  color: #8A8FA3;
  font-weight: 400;
}
.ts-search__clear {
  width: 38px;
  height: 38px;
  min-width: 38px;
  min-height: 38px;
  padding: 0;
  margin: 0;
  border: none;
  box-sizing: border-box;
  background: #F1F2F6;
  border-radius: 50%;
  display: grid;
  place-items: center;
  cursor: pointer;
  color: #6B7280;
  flex-shrink: 0;
  transition: background 0.15s;
  line-height: 1;
  font-size: 0;
}
.ts-search__clear:hover { background: #E5E7EB; color: #1A1F2E; }
.ts-search__clear svg {
  width: 16px;
  height: 16px;
  display: block;
}

.ts-search__dropdown {
  position: absolute;
  top: calc(100% + 12px);
  left: 0; right: 0;
  background: #fff;
  border-radius: 20px;
  box-shadow: 0 24px 60px -12px rgba(15,23,42,0.28), 0 4px 12px rgba(0,0,0,0.08);
  overflow: hidden;
  z-index: 50;
  max-height: 480px;
  overflow-y: auto;
}
.ts-search__row {
  width: 100%;
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 14px 18px;
  border: none;
  background: transparent;
  text-align: left;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  border-bottom: 1px solid #F1F2F6;
  transition: background 0.15s;
}
.ts-search__row:last-of-type { border-bottom: none; }
.ts-search__row--active { background: #F7F8FB; }
.ts-search__row-main { flex: 1; min-width: 0; }
.ts-search__row-title {
  font-weight: 700;
  color: #1A1F2E;
  margin-bottom: 2px;
  font-size: 0.95rem;
}
.ts-search__row-title mark,
.ts-search__row-sub mark {
  background: #E7E8FF;
  color: inherit;
  padding: 0 2px;
  border-radius: 3px;
}
.ts-search__row-sub {
  font-size: 0.85rem;
  color: #6B7280;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.ts-search__row-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
.ts-search__row-cat {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ts-accent);
  background: #E7E8FF;
  padding: 3px 8px;
  border-radius: 999px;
  white-space: nowrap;
}
.ts-search__empty {
  padding: 24px 18px;
  text-align: center;
}
.ts-search__empty-title {
  font-weight: 700;
  color: #1A1F2E;
  margin-bottom: 4px;
}
.ts-search__empty-sub {
  font-size: 0.875rem;
  color: #6B7280;
}
.ts-search__empty-sub a {
  color: var(--ts-accent);
  font-weight: 500;
  text-decoration: underline;
}
.ts-search__footer {
  padding: 10px 16px;
  border-top: 1px solid #F1F2F6;
  font-size: 0.75rem;
  color: #6B7280;
  display: flex;
  gap: 14px;
  align-items: center;
}
.ts-search__footer kbd {
  display: inline-block;
  font-family: inherit;
  font-size: 0.7rem;
  background: #F1F2F6;
  border-radius: 4px;
  padding: 2px 6px;
  margin-right: 4px;
  font-weight: 600;
  color: #4A5168;
}
@media (max-width: 640px) {
  .ts-search__input { font-size: 1rem; padding: 14px 4px; }
  .ts-search__row-meta { display: none; }
}
